Hi, I am using JQGrid in my application and filtering the record on key press of a textbox matching with one column, but when I type more than one character in the textbox it is taking more time to type the accept the other character because the grid is already reloading. When the grid is loaded then the textbox takes the second character. I just want to stop reloading the grid if user is continuously entering text in the textbox. Please help me. Thanks in advance.
What I have tried:
function doIpRefQuicksearch(){
var searchText = $.trim($('#QUICK_SEARCH_TEXT_IPREF').val());
var grid = $('#IP_REFERRAL_GRID');
var filterByStatus;
if(searchText){
grid[0].p.search = true;
} else {
grid[0].p.search = false;
}
filterByStatus = {
groupOp : "OR",
rules : []
};
filterByStatus.rules.push({
field : "mrNumber",
op : "cn",
data : searchText
});
grid.jqGrid('setGridParam',{
ignoreCase: true,
});
$.extend(grid[0].p.postData, {
filters : JSON.stringify(filterByStatus),
});
grid.trigger("reloadGrid", [{
page : 1,
current : true,
ignoreCase:true
}]);
}