My dataTable version is 1.10.4. I'm populating the datatable by passing the Javascript sourced data
var dataSet = [
['Trident', 'Internet Explorer 4.0', 'Win 95+', '4', 'X'],
['Trident', 'Internet Explorer 5.0', 'Win 95+', '5', 'C']
//----
];
$(document).ready(function () {
$('#demo').html('<table cellpadding="0" cellspacing="0" border="0" class="display" id="example"></table>');
$('#example').dataTable({
"data": dataSet,
"columns": [
{ "title": "Engine" },
{ "title": "Browser" },
{ "title": "Platform" },
{ "title": "Version", "class": "center" },
{ "title": "Grade", "class": "center" }
]
});
});
Now I have a search input to filter the table based on the input. I'm trying to get the filtered data that returns and rendering in the table.
For example, If the users search input is 'C' then i should get filtered data
var dataSet = [ ['Trident','Internet Explorer 5.0','Win 95+','5','C'] ];
Is there any standard way of getting filtered data in datatable?
if not I want to get the array on key up
$( "#searchInput").on( 'keyup change', function () {
// get the filtered JavaScript data
});
Please refer to JSFIDDLE HERE