After digging through the source a little it appears something sort of like this already exists.
There is an undocumented property in filtertoolbar (line 174 of grid.custom.js, v4.5.4) called searchurl.
filterToolbar : function(p){
      p = $.extend({
         autosearch: true,
         searchOnEnter : true,
         …
         searchurl : ”,
It looks like if you set the searchurl it’ll save the grid url, send in the filter, reload the grid with the filtered data and reset the url. This behavior is not in the ‘searchGrid’ method :(..
In fact looking between toolbar filtering and seachbox filtering there are some pretty big differences between the two. Maybe this is a good place to look for future releases to remove some redundancy…
How do you make the searchbox appear with the ability to get/post to a different url? I already have a custom button, that opens a custom modal for report generation. However the searchbox has really good ways of adding/removing filters. However the searchboxes job is to filter the grid on the same url the grid is getting its data from, in other words the searchbox URL is dependent on the grid. I need something that can read the colmodel and be independent of where the data is coming from. I already have the code to search and sort the grid when the searchbox button is pressed. I have server side handlers to parse the filter into a where clause for a sql statement. It’d be nice to reuse everything.
Ben
This bug still exists in 4.4.1..
Here is an update:
The documentation on /jqgridwiki/doku.php?id=wiki:singe_searching
says the default is null. So you don't expect a return type.. However if you
javiut said:Hey Grausam. do you solve the problem?? if you do can you upload the file fixed. thanks..
I don't know if this is a good fix. It works for me but I don't know if it will work for everyone. I am not a mod so I hope the fix will appear in 4.4.1.. I don't think the javascript fun.call() method returns anything and that's the bug. Can someone confirm this for me.
I am having the same problem.
I modified jqgrid.src at line 6878 function showFilter(_filter)
function showFilter(_filter) {
showFrm = $($t).triggerHandler(“jqGridFilterBeforeShow”, [_filter]);
console.log(“shwFrm:”,showFrm);
if(typeof(showFrm) === “undefined”) {
showFrm = true;
}
if(showFrm && $.isFunction(p.beforeShowSearch)) {
console.log(“calling before show search, showFrm is now:”, showFrm);
showFrm = p.beforeShowSearch.call($t,_filter);
console.log(“function called, showFrm is now:”, showFrm);
}
if(showFrm) { … }
This produces:
shwFrm:
My work around for this is
Copyright 2014 TriRand LtdAll Rights ReservedRSS
Back to Top