yadcf - custom_select selectize bizarre behavior

2019-02-20 14:34发布

问题:

Trying to use custom_select with selectize and I am seeing bizarre behavior. The select field gets duplicated as do the reset buttons, and when I pick one of the selects, the fields multiply.

Initializing selectize with

  var _selectize;
  yadcf.initSelectPluginCustomTriggers(
    function($filterSelector) {
      _selectize = $filterSelector.selectize({});
    },
    function($filterSelector) {
      _selectize.refreshItems()
    },
    function($filterSelector) {
      _selectize.destroy()
    });

Initializing yadcf with

var yadcf_options = [{
  'column_number': 0,
  'filter_container_id': "_rrwebapp_filtername",
  'filter_type': "multi_select",
  'select_type': 'custom_select',
  'select_type_options': {
    'width': '30em',
  },
  'filter_reset_button_text': 'all',
}, {
  'column_number': 1,
  'filter_container_id': "_rrwebapp_filterseries",
  'filter_reset_button_text': 'all',
}, ];

See http://codepen.io/louking/pen/KzVwwg for details

Compare to when using select2 (which has another problem, but that's for another question) http://codepen.io/louking/pen/RarNwd

标签: yadcf