Quantcast
Channel: DataTables 1.9 — DataTables forums
Viewing all articles
Browse latest Browse all 1816

Solution::for Ajax autoload

$
0
0
Hello,

I solved the problem with ajax autoload by applying this 'hack'.

    $(document).ready( function() {
        $(window).bind('focus', function() {
            oTable.fnFilter('',0);
        });
    });

Now when user triggers 'focus' event on 'window', DataTables trying to perform an empty search which leads to AJAX autoload and displaying the data.
In my case I have search enabled for every column in a table, '0' is very first column.
In case you want to search using a Global search (not so efficient), just remove the '0' - oTable.fnFilter('')

If you don't like the hack, please look at this API - http://datatables.net/plug-ins/api#fnReloadAjax

P.S. Worked for me with DataTables 1.9.4

BR,
t0m

Viewing all articles
Browse latest Browse all 1816

Trending Articles