开发者

In jqgrid, after setting stringResult=true, my filters no longer work

i was previously using the basic filter where filters would show up in the URL querystring as

 [Field]=[Value]

To support more advanced filtering, i switched stringResult=true

$("#grid").jqGrid('filterToolbar', { stringResult: true, searchOnEnter: true })

which is great but i have many pages that i just realized are broken as i had previously sent out links like:

http://www.mysite.com/Applications?Team=MyTeam

what is nice ab开发者_如何学JAVAout this is that the filter is persisted as part of the URL. Is there anyway i can support this type of format but still use stringResult=true on top of this to support the more advance filter ?


The url like http://www.mysite.com/Applications?filter=... is also a part of the URL. Why it's less good?

About the broken old links I see no way as to modify there (one should know where they are solved) or to continue your server components support of old style parameters additionally to the stringResult: true style.

One more way is to use URL redirection of old style URLs to the new one, but the implementation is very depend on the web server which you use and the technique which you use to write server components.

UPDATED: For example the URL send to the server by the page is

"http://www.ok-soft-gmbh.com/jqGrid/SearchDataUrl.json?filters=%7B%22groupOp%22%3A%22AND%22%2C%22rules%22%3A%5B%7B%22field%22%3A%22Status%22%2C%22op%22%3A%22ne%22%2C%22data%22%3A%22Completed%22%7D%2C%7B%22field%22%3A%22Status%22%2C%22op%22%3A%22ne%22%2C%22data%22%3A%22On+Hold%22%7D%2C%7B%22field%22%3A%22Status%22%2C%22op%22%3A%22ne%22%2C%22data%22%3A%22Cancelled%22%7D%5D%7D&_search=false&nd=1300712766637&rows=10&page=1&sidx=Id&sord=asc"

if you decode this with respect unescape JavaScript function you will receive the following:

"http://www.ok-soft-gmbh.com/jqGrid/SearchDataUrl.json?filters={\"groupOp\":\"AND\",\"rules\":[{\"field\":\"Status\",\"op\":\"ne\",\"data\":\"Completed\"},{\"field\":\"Status\",\"op\":\"ne\",\"data\":\"On+Hold\"},{\"field\":\"Status\",\"op\":\"ne\",\"data\":\"Cancelled\"}]}&_search=false&nd=1300712766637&rows=10&page=1&sidx=Id&sord=asc"

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜