Here I have a search form and a grid. The grid has configured a URL and datatype 'json'.
When search form submit, it will trigger grid reload, with parameters collected in the search form get submitted.
Now I want to add local filtering ability using filterToolbar
. i.e. let the user filter the result on-screen. So the sear开发者_开发百科ch form remains a server-search. The toolbar is for local-search.
I tried using beforeSearch
and afterSearch
var g = $("#grid").filterToolbar({
beforeSearch: function(){ g.setGridParam({datatype:'local'}); },
afterSearch: function(){ g.setGridParam({datatype:'json'}); }
})
but it turn out that once datatype:'local'
is applied, any search in filterToolbar will remove all record on screen.
As I still want the server-search, I don't use loadonce
.
Any other way to do that?
精彩评论