我试图在我的数据表中使用yadcf插件,因为它可以灵活使用。它生成下拉多选过滤器,在特定行中提供值。我想自定义这样一种方式来传递我自己的列表和值对应于相同的(列表),但没有得到我怎么能做到这一点。如果有人能在这方面指导我,我会感激你的。
{
column_number: 1,
filter_type: "multi_select",
select_type: 'select2',
filter_reset_button_text: false
}]);
你应该使用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
*