我想使用cumulative_filtering并在页脚中显示过滤器,而不是标题。这两个功能都是独立工作的,但是当我将两个选项一起包含时,cumulative_filtering不起作用(tfoot选项仍在工作)。我如何一起使用这两个选项?谢谢!
yadcf.init(table, [
{ column_number: 1, filter_reset_button_text: false, select_type: 'select2' },
{ column_number: 2, filter_reset_button_text: false, select_type: 'select2' },
{ column_number: 3, filter_reset_button_text: false, select_type: 'select2' },
{ column_number: 4, filter_reset_button_text: false, select_type: 'select2' },
{ column_number: 6, filter_reset_button_text: false, select_type: 'select2' },
{ column_number: 7, filter_reset_button_text: false, select_type: 'select2' },
{ column_number: 8, filter_reset_button_text: false, select_type: 'select2', column_data_type: "html", html_data_type: "text" }
],
'footer',
{ cumulative_filtering: true }
)
累积过滤:http://yadcf-showcase.appspot.com/cumulative_filtering.html
根据文档 - "过滤器可以放在标题(thead)或页脚(tfoot)中,yadcf构造函数的第二个参数或init函数的第三个参数"
答案 0 :(得分:2)
文档有点不清楚(很快就会对这个功能进行更新), 无论如何,既然你想指定过滤器位置并使用累积量,你应该按照以下方式使用它
yadcf.init(table, [
{ column_number: 1, filter_reset_button_text: false, select_type: 'select2' },
{ column_number: 2, filter_reset_button_text: false, select_type: 'select2' },
{ column_number: 3, filter_reset_button_text: false, select_type: 'select2' },
{ column_number: 4, filter_reset_button_text: false, select_type: 'select2' },
{ column_number: 6, filter_reset_button_text: false, select_type: 'select2' },
{ column_number: 7, filter_reset_button_text: false, select_type: 'select2' },
{ column_number: 8, filter_reset_button_text: false, select_type: 'select2', column_data_type: "html", html_data_type: "text" }
],
{
filters_position: 'footer',
cumulative_filtering: true
}
)
它的第三个参数作为字符串(用于位置)或第三个参数用于具有filters_position
键和'footer'作为值的对象。