Problem using fnSetFilteringDelay on Server Side Pagination

Problem using fnSetFilteringDelay on Server Side Pagination

kvn9328kvn9328 Posts: 18Questions: 7Answers: 0
edited December 2014 in Free community support

Hi,

I am using server-side pagination with column search. I need to delay searches and i tried to use fnSetFilteringDelay and it is not working for me.

$('#tree-data-table tfoot th').each( function () {
        var title = $('#tree-data-table thead th').eq( $(this).index() ).text();
        $(this).html( '<input type="text" placeholder="Search '+title+'" />' );
} );
        var table = $('#tree-data-table').DataTable({
        "processing": true,
        "serverSide": true,
        "destroy": false,
        "searching": true,
        "deferRender":true,
        "ajax": {
        "url":"ajax-groupView.html",
        "data": function(d) {
        var searchCriteria = {};
        searchCriteria.groupId = group_Id[1];
        d.searchCriteria = searchCriteria;
        return JSON.stringify(d);
        },
        "type":"POST",
        },
        "columns": [{"data":"type"},{"data":"relatedGroup.id"},{"data":"relatedGroup.service.serviceName"},{"data":"relatedGroup.service.methodName"},{"data":"relatedGroup.transactionStatus"},{"data":"relatedGroup.deliveryStatus"},{"data":"relatedGroup.created"}]
        }); 
        
        $('#tree-data-table').dataTable().fnSetFilteringDelay();
table.columns().eq( 0 ).each( function ( colIdx ) {
        $( 'input', table.column( colIdx ).footer() ).on( 'keyup change', function () {
             table.column( colIdx ).search( this.value ).draw();
           } );
        } );

@allan,

could you let me know, what i am missing.

I have included js with cdn: //cdn.datatables.net/plug-ins/3cfcc339e89/api/fnSetFilteringDelay.js

I am using 1.10.4 version of datatables.

Thanks!

This discussion has been closed.