How can I set postData._search to true in the request in jqGrid?(如何在 jqGrid 的请求中将 postData._search 设置为 true?)
问题描述
虽然我已经能够以编程方式添加自己的帖子数据,但我似乎无法弄清楚如何让此代码在请求中发送 _search: true.
While I've been able to add my own post data programmatically, I cannot seem to figure out how to get this code to send _search: true in the request.
var data = grid.jqGrid("getGridParam", "postData");
data._search = true;
data.searchString = id.toString();
data.searchOper = "eq";
data.searchField = "userid";
grid.jqGrid("setGridParam", { "postData": data });
grid.trigger("reloadGrid");
这些字段已正确添加,但在某处 _search 似乎设置为 false,因为每个请求都将其设置为 false.我还需要做些什么才能让它真实"吗?我正在运行工具栏搜索,但大多数时候调用此代码时没有输入任何内容,并且我的服务器上的大量实用程序代码会在处理搜索之前检查 _search.
The fields are added correctly, but somewhere along the way _search appears to be set to false, because every request has it set to false. Is there some other thing I have to do to have it "true"? I'm running a toolbar search, but most of the time when this code will be called there's nothing entered, and a decent chunk of utility code on my server checks _search before handling searches.
推荐答案
还有一个额外的参数,search,需要设置它来启动搜索.postData 的 _search 参数不需要显式设置.我建议查找一些旧答案,您可以在其中找到如何使用搜索的示例:
There is an additional parameter, search, which need be set to initiate the searching. The _search parameter of postData need not be set explicitly. I recommend to look up some old answers where you find examples how to work with searching: 
- jqGrid 客户端搜索
 - jqGrid:使用多种方法过滤数据
 - jqGrid 清除搜索条件
 
这篇关于如何在 jqGrid 的请求中将 postData._search 设置为 true?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:如何在 jqGrid 的请求中将 postData._search 设置为 true?
				
        
 
            
        - 如何使用 JSON 格式的 jQuery AJAX 从 .cfm 页面输出查 2022-01-01
 - 使用RSelum从网站(报纸档案)中抓取多个网页 2022-09-06
 - Flexslider 箭头未正确显示 2022-01-01
 - 失败的 Canvas 360 jquery 插件 2022-01-01
 - CSS媒体查询(最大高度)不起作用,但为什么? 2022-01-01
 - Css:将嵌套元素定位在父元素边界之外一点 2022-09-07
 - 400或500级别的HTTP响应 2022-01-01
 - Fetch API 如何获取响应体? 2022-01-01
 - addEventListener 在 IE 11 中不起作用 2022-01-01
 - Quasar 2+Apollo:错误:找不到ID为默认的Apollo客户端。如果您在组件设置之外,请使用ProvideApolloClient() 2022-01-01
 
						
						
						
						
						