是否可以为yadcf添加默认值参数?

时间:2018-03-01 16:28:54

标签: yadcf

有没有办法为过滤器样式设置默认参数?如下例所示?

 $.extend(true, $.fn.dataTable.defaults, {
        "ordering": false,
        "paging": false,
        "info": false,
        "autoWidth": false,
        "language": {
            "emptyTable": "bla bla",

        },
    });

我的yadcf exapmle如下

yadcf.init($Table,
     [{
     column_number: 0,
     filter_default_label: "Filter By Category",
     filter_container_id: "FilterContainer_Category",
     reset_button_style_class: "yadcf-bg-dark-theme",
     style_class: "custom-select"
     }]
);

1 个答案:

答案 0 :(得分:0)

您添加为yadcf init函数的第三个参数的任何内容都将用作全局参数,

所以你可以做以下

yadcf.init(oTable, [{
    column_number: 0
  },
  {
    column_number: 3
  }
], {
  reset_button_style_class: "yadcf-bg-dark-theme",
  style_class: "custom-select"
});