开发者

JQGrid, Search related issue

开发者 https://www.devze.com 2023-02-26 03:22 出处:网络
Is there anyway to validate the search field (I\'m using custom search) before sending request to server? Validation is working fine with row editing and adding mode. Let say I want to search column p

Is there anyway to validate the search field (I'm using custom search) before sending request to server? Validation is working fine with row editing and adding mode. Let say I want to search column price and error message should occur when user enters a text in search field. If search returns no data, I want to post a message on the screen. I see no events in search function that can get the server response. The onClose event happened when the search box is closed, but I don't know how to get the server response from this?

Another question, I've tried to use gridResize but it's not working, everything else is working just fine, I see no resize icon in bottom right corner. Please take a look at my code below:

jQuery("#list").jqGrid('gridResize',{minWidth:350,maxWidth:800,minHeight:80开发者_运维百科, maxHeight:350});


The part of your question about the validation of the custom searching seems be the same which I answerd here. The answer include the demo where the validation of the 'Client' field is included.

How you can see, the custom searching is moved in the grid.addons.js module in the 4.0.0 version of jqGrid, so it can be removed in some later versions of jqGrid.

There are no special searching request to the server. There are exist just the standard request to fill the grid, where the _search parameter (corresponds to search parameter of jqGrid) are set to true and some other parameters like filters describe the filter criteria. So you can use emptyrecords parameter of jqGrid (see here). You can follow the demo (see the answer) which shows the message in the grid body.

You problems with gridResize seams me very easy. i suppose, that you either not included jQuery UI JavaScript (including of CSS only is not enough) or you placed call of gridResize in the wrong place. You don't posted the JavaScript code and the HTML code which could shows which JavaScripts files you have loaded and in which order. So I can not answer more exactly.

0

精彩评论

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