我正在尝试将yadcf插件用于我的数据表中的多选插件,因为它可以灵活使用。它生成下拉式多选过滤器,其值在特定行中可用。我想以这样的方式自定义这个以传递我自己的列表和对应于相同(列表)的值但不知道我该怎么做。如果有人能指导我,我将非常感激你。
{
column_number: 1,
filter_type: "multi_select",
select_type: 'select2',
filter_reset_button_text: false
}]);
答案 0 :(得分:0)
您应该使用data属性
例如
{
column_number: 1,
filter_type: "multi_select",
select_type: 'select2',
filter_reset_button_text: false,
data: ["value1","value2"]
}
以下是文档中的小片段(为了了解yadcf功能,您最好阅读更多内容)
* data
Required: false
Type: Array (of string or objects)
Description: When the need of predefined data for filter is needed just use an array of strings ["value1","value2"....] (supported in select / multi_select / auto_complete filters) or
array of objects [{value: 'Some Data 1', label: 'One'}, {value: 'Some Data 3', label: 'Three'}] (supported in select / multi_select filters)
Note: that when filter_type is custom_func / multi_select_custom_func this array will populate the custom filter select element
*