开发者

How can I set postData._search to true in the request in jqGrid?

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");

The fields are added correctly, but somewhere along the way _search appears to be set to false, because开发者_如何学JAVA 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.


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 client-side searching
  • jqGrid: using multiple methods to filter data
  • jqGrid clear search criteria
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜