The local searching is similar to this tutorial. All you need to do is to filter the 'data' and call 'loadData' method to render the new rows. Please see the 'doSearch' function to learn how to achieve this functionality.
Code:
function doSearch(q){
var rows = [];
$.map(data, function(row){
for(var p in row){
var v = row[p];
if (String(v).indexOf(q) >= 0){
rows.push(row);
break;
}
}
});
$('#dg').datagrid('loadData', rows);
}
Great, thanks! This is works as expected. I just changed the string checking to be more flexible:
function doSearch(q){
var rows = [];
$.map(data, function(row){
for(var p in row){
var v = row[p];
var regExp = new RegExp(q, 'i'); // i - makes the search case-insensitive.
if(regExp.test(String(v))) {
rows.push(row);
break;
}
}
});
$('#dg').datagrid('loadData', rows);
}
Thanks again.

