添加 'tfoot' 会阻止 Cumulative_Filtering 工作

Adding 'tfoot' Prevents Cumulative_Filtering from Working

我想使用 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

根据文档 - "Filters can be placed in the header (thead) or in the footer (tfoot) , second argument of yadcf constructor or third argument of init function"

文档有点不清楚(将很快更新有关此功能的信息), 无论如何,既然你想指定过滤器位置并使用累积,你应该按以下方式使用它

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' 作为值的对象的第三个参数。