Sending search request to Datatables jquery plugin
Has anyone ever sent a search request from one page to the dataTables jquery plugin on another page? I'm not sure if its even 开发者_运维问答designed to work that way.
I think this is what you are looking for:
$('#dataTableBLOCK').dataTable( {
"oSearch": {"sSearch": "YOUR-SEARCH-VALUE"},
"bProcessing": true,
"bServerSide": true,
"sAjaxSource": "NAME-OF-DATATABLES-FILE.php"
} );
By changing YOUR-SEARCH-VALUE
to a $_POST
or $_GET
value you make dataTables search what you were searching somewhere else.
I am very sure that the search will only work when you are in the same page. The search box will filter the displayed rows of the table when the dataTables plugin is used.
精彩评论