Javascript IgnitedDataables服务器端列筛选

Javascript IgnitedDataables服务器端列筛选,javascript,jquery,codeigniter,datatables,Javascript,Jquery,Codeigniter,Datatables,最近,我在使用datatables和ignited datatables库时遇到了一个问题 我使用了数据表。1.10.4和点火器。2.0 似乎我不能像这个链接中提到的那样进行单独的列过滤: 因为每次执行键控时,表都会重新加载,但筛选条件不会绑定到数据中。无论如何,通过使用chrome调试工具,我知道用于搜索的字符串已发送到服务器:columns[2][search][value]:一些字符串,但不知何故服务器无法处理此字符串 以下是我的javascript代码: table = $('#dat

最近,我在使用datatables和ignited datatables库时遇到了一个问题

我使用了数据表。1.10.4和点火器。2.0

似乎我不能像这个链接中提到的那样进行单独的列过滤:

因为每次执行键控时,表都会重新加载,但筛选条件不会绑定到数据中。无论如何,通过使用chrome调试工具,我知道用于搜索的字符串已发送到服务器:columns[2][search][value]:一些字符串,但不知何故服务器无法处理此字符串

以下是我的javascript代码:

table = $('#data_table').DataTable( {
    'filter': true,
    'processing': true,
    'serverSide': true,
    'ajax': {
        'url' : '<?=site_url()?>/technician/get_data',
        'type' : 'POST',
        'data' : lar_data
    },
    'columns':[
        {'data' : 'opt_edit', 'sortable' : false,'searchable' : false},
        {'data' : 'opt_detail', 'sortable' : false, 'searchable' : false},
        {'data' : 'TechnicianName'},
        {'data' : 'TechnicianAddress'},
        {'data' : 'TechnicianMobileNumber'},
        {'data' : 'opt_delete', 'sortable' : false, 'searchable' : false}
    ],
    'order' : [[2, 'asc']]
} );

table.columns().eq( 0 ).each( function ( colIdx ) {
    $( 'input', table.column( colIdx ).footer() ).on( 'keyup', function () {
        table
            .columns( colIdx )
            .search( this.value )
            .draw();            
    } );
} );
模型:

function __construct()
{
    parent::__construct();
    $this->load->library('Datatables');
}

function get($filter)
{
    $this->datatables->select('
        TechnicianName,
        TechnicianAddress,
        TechnicianMobileNumber
    ');
    $this->datatables->add_column(
        'opt_edit',
        '<a href="#">Edit</a>'
    );
    $this->datatables->add_column(
        'opt_detail',
        '<a href="#">Detail</a>'
    );
    $this->datatables->add_column(
        'opt_delete',
        '<a href="#"><span class="glyphicon glyphicon-remove" aria-hidden="true"></span></a>'
    );
    $this->datatables->from('ms_technician');
    $this->datatables->where($filter);

    return $this->datatables->generate();
}
视图:

<div class="table-responsive">
    <table id="data_table" class="table table-striped table-bordered table-hover">
        <thead>
            <tr>
                <th width="1px">&nbsp;</th>
                <th width="1px">&nbsp;</th>
                <th>Name</th>
                <th>Address</th>
                <th>Mobile Phone</th>
                <th width="1px">&nbsp;</th>
            </tr>
        </thead>
        <tfoot>
            <tr>
                <th width="1px">&nbsp;</th>
                <th width="1px">&nbsp;</th>
                <th>Name</th>
                <th>Address</th>
                <th>Mobile Phone</th>
                <th width="1px">&nbsp;</th>
            </tr>
        </tfoot>
        <tbody></tbody>
    </table>
</div>
有人能帮我解决这个问题吗? 非常感谢你的帮助