Quantcast
Channel: Recent Discussions — DataTables forums
Viewing all articles
Browse latest Browse all 81690

Easy way of programmatically filtering in DataTable

$
0
0
Hi,
I've registered at the forum only for share a solution I found, for a problem I had for days about filtering a Datatable from code.
I've tried afnFiltering.push with no success, because I wasn't able to restore the table to their original data.
My code is as below:

var filterCtrl= $("#myDatatable_filter :input"); //locate DOM element input (it will be the input SEARCH field) inside the div "myDatatable_filter"... in both Firefox and IE, the div containing the filter renders this way
filterCtrl.val("my Value to search for"); //value to the input "SEARCH"
filterCtrl.keyup(); //Fire event key up, for the search to work

I hope this help somebody,
Bye!

Viewing all articles
Browse latest Browse all 81690

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>