Click here to Skip to main content
15,887,361 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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
}]);
}
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900