本文介绍了如何检查gridreload是否仍在运行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 29岁程序员,3月因学历无情被辞! 我在我的应用程序中使用JQGrid并按下与一列匹配的文本框的按键过滤记录,但是当我在文本框中键入多个字符时,需要更多时间来键入接受另一个字符因为网格已经重新加载。加载网格后,文本框将采用第二个字符。如果用户在文本框中不断输入文本,我只想停止重新加载网格。请帮我。在此先感谢。 我尝试过: 函数doIpRefQuicksearch (){b / b $ b 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:或, 规则:[] }; filterByStatus.rules.push({ 字段:mrNumber, 操作:cn, 数据:searchText }); grid.jqGrid('setGridParam',{ ignoreCase:true, }); $ .extend(grid [0] .p.postData,{ 过滤器:JSON.stringify(filterByStatus), }); grid.trigger(reloadGrid, [{ 页数:1, 当前:true, ignoreCase:true }]); }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}]);}推荐答案 这篇关于如何检查gridreload是否仍在运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!
05-28 10:31
查看更多