I am using the below code to filter the record from jquery data table.My data table format like this
var aDataSet = [['1', 'GOld', 'G-110,G-112,G-123', 'G1-001,G1-005,G1-008'],
['2', 'GOld type 1', 'G1-001,G1-003,G-123', 'G-110,G-112,G-156']];
$(document).ready(function () {
oTable = $('#example').dataTable();
oTable.fnFilter('G-110,G-112');
});
Suppose i give the input value like 'G-110,G-112' to the above function means the out put like this
The above two records are displayed.
Suppose my input is G1-001,G1-003,G-156 means the second record only displayed.
I want to filter the most of the item present in the data table row.
you have to include check for the regexp
in fnFilter function
:
fnFilter
function has these elements as parameter
s:
so your filter function should look like this:
oTable.fnFilter('G-110,G-112',null,true);
//this will check your row based on regular expression also.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.