YADCF,列可见性在 filter_container_id 下无法正常工作

YADCF, column visibility doesn't work properly with filter_container_id

Datatables、YADCF 和 Button Colvis 有点问题: 我不能在同一个 table 中使用 属性 visible:false、filter_container_id 和 yadcf。 yadcf 插件崩溃并且不显示任何内容。这是我的数据 table 初始化的清理版本:

datatable = $('#Datatable').DataTable({
    serverSide:true,
    processing:true,
    ajax: {
        url: '/app/object/liste',
        type: "POST"
    },
    columns: [
        {data:"pc_id", width:"90px"},
        {data:"pc_statut", visible:false, width:"90px"},
        {data:"reference_dossier", width:"90px"}],
    buttons: [{
        extend: 'colvis',
        text: 'Colonnes',
        collectionLayout: 'fixed three-column',
        columns: ':gt(0)'
    }],
    initComplete:function(a, b){
        new $.fn.dataTable.FixedColumns(datatable, {
            leftColumns: 1
        });

        var clonedTable = document.querySelectorAll('.DTFC_Cloned');
        for (var i = 0; i < clonedTable.length; i++){
            clonedTable[i].id = 'DTFC_Cloned';
        }
        $('#DTFC_Cloned thead tr:eq(1) th:last-child').append(
            '<span id="fixed_col_filter_container"></span>'
        );

        yadcf.init(
            datatable,
            [
                {
                    column_number:1,
                    filter_container_id:"fixed_col_filter_container",
                    filter_type:"text",
                    filter_delay:"500"
                },{
                    column_number:2,
                    filter_container_id:"pc-pc_statut-2",
                    filter_type:"text",
                    filter_delay:"500"
                },{
                    column_number:3,
                    filter_container_id:"pc-reference_dossier-2",
                    filter_type:"text",
                    filter_delay:"500"
                }
            ],
            {language: tabLanguage}
        );
    }
});

我添加了对 yadcf 的修复并修复了您的代码,

获取最新的 0.9.0.beta.23 并注意 column_number 值是基于零的(第一列应该有 column_number: 0 等等)

See it working here