1

When I create an external filter for a yadcf column, which uses select2 as the selection method, the font in the selections does not follow the .body font specified in the wrapper <div>

Is there any way to control this?

See http://codepen.io/louking/pen/rxKeob click in Match field. You can see the font has serif but .body font is Arial, Helvetica, sans-serif.

Note I am using yadcf 0.8.8+ (through commit https://github.com/vedmack/yadcf/commit/4b778d7747c5c1cd4f362e6a6154c172f4a88ad3)

html shown below

<div class=body>
  <label class="Label">Match:</label><span id="select"></span>

  <table id=tbl class=DataList width=100%>
    <thead>
      <tr>
        <th>col0</th>
        <th>col1</th>
        <th>col2</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td>text-obvious</td>
        <td>b0</td>
        <td>c0</td>
      </tr>
      <tr>
        <td>more-text</td>
        <td>b1</td>
        <td>c1</td>
      </tr>
    </tbody>
  </table>
</div>

js shown below

options = {
  dom: '<"H"lBpfr>t<"F"i>',
  jQueryUI: true,
  paging: false,
  scrollY: true,
  scrollCollapse: true,
  scrollX: true,
};

var yadcffilters = [{
  column_number: 0,
  filter_container_id: "select",
  column_data_type: "text",
  filter_match_mode: "exact",
  filter_type: "multi_select",
  select_type: 'select2',
  select_type_options: {
    width: '20em',
  },
  filter_reset_button_text: 'all',
}];

var table = $('#tbl').dataTable(options)
  .yadcf(yadcffilters);
Lou K
  • 1,128
  • 2
  • 12
  • 31
  • Not sure to which elemet exactly you are referring as having serif font, I noticed some with Arial that is being overriden by `user agent` , not sure if that helps you much but you can specify font per element as I did in the [codepen example](http://codepen.io/anon/pen/qbKpZp) – Daniel Jan 30 '16 at 19:32
  • I'm looking at the font of the select options, which does not appear to be fixed by your css suggestion. Compare the behavior and font on the pulldown options using select2 in my original example and your update to another example using chosen: http://codepen.io/louking/pen/GoGGbW I'm want to standardize on select2 because it has a better feature set than chosen. – Lou K Jan 31 '16 at 10:42
  • take a look at those links http://stackoverflow.com/questions/24347340/styling-of-select2-dropdown-select-boxes and http://stackoverflow.com/questions/30060169/changing-font-color-of-selected-item-by-user-with-select2 – Daniel Feb 04 '16 at 08:42
  • I ended up deciding to standardize on selectize. I see yadcf 0.8.9 supports additional select types other than chosen and select2. Is there an example which uses selectize? – Lou K Feb 14 '16 at 14:27
  • No, sorry, but you can read the docs and ask the author of the PR on github for example https://github.com/vedmack/yadcf/pull/212 – Daniel Feb 14 '16 at 15:24
  • 1
    Daniel - I am getting bizarre behavior when I try to use this with selectize. Would you entertain a pull request for 'native' yadcf selectize support? – Lou K Mar 05 '16 at 20:25
  • You asking what I think about getting a PR? sure feel free to send PR :) if you want you can provide an example using selectize with the bizzare.... – Daniel Mar 05 '16 at 21:02
  • actually I got the same bizarre behavior (several selects and reset buttons created, which multiply when I select an option) when I tried to update your code natively to use selectize. I'll try to come up with an example but it's difficult because I'm using ajax to retrieve the select data (yadcf_data_0, etc). Is there an ajax server I can use or do I have to create my own for the bin? – Lou K Mar 05 '16 at 22:12
  • Or is there a way to simulate an ajax server somehow? – Lou K Mar 05 '16 at 22:26
  • yes, you can use `"sAjaxSource": "resources/sources/deep.txt",` like I did on showcase http://yadcf-showcase.appspot.com/ajax_mData_source.html – Daniel Mar 06 '16 at 07:41
  • am using my own source - I figured it's time for a specific question: http://stackoverflow.com/questions/35830152/yadcf-custom-select-selectize-bizarre-behavior – Lou K Mar 06 '16 at 17:40

0 Answers0