tonytomov / jqGrid

jQuery grid plugin
www.trirand.com
2.85k stars 1.2k forks source link

Advanced search modal #906

Closed BogMil closed 6 years ago

BogMil commented 6 years ago

The thing is when i use: Method1: $('#ID_grid').jqgrid('searchGrid',{ multipleSearch:true });

Advanced search modal is shown right when the page loads with no need to click on searc icon.

Maybe that is not problem at all, but when using: Method2: $('#ID_grid').navGrid('#ID_pager',{ edit:true, ... }, {}, {}, {}, {multipleSearch:true}); Everything is fine...

9484 line in jquery.jqgrid.js: showFilter($('#'+fid)); When commenting that line and using Method2, on first load of page you should have to click twice on search icon for search modal to pop up. Check DOM on very first click. On that click it just create modal in html code, but not showing it... After that click everything is ok...

tonytomov commented 6 years ago

I'm not sure that I understand the problem. In navGrid there is a search option called showOnLoad which executes the search modal when the script executes which is exactly what you do in your first method.

BogMil commented 6 years ago

I didn't use showOnLoad:true explicitly in first method. And even if i set it to false it loads again as if it set to true. And that is not the case with the second method. In second method showOnLoad works.

tonytomov commented 6 years ago

I really don't understand what is the problem!?!

BogMil commented 6 years ago

I want advanced search enabled. And i get different result depending on where did i specified option : multipleSearc:true. With this method: $('#ID_grid').jqgrid('searchGrid',{ multipleSearch:true }); i always get modal for advanced (multiple) searching shown when page loads (when refreshing page). So when the page is loaded, modal pops up even thought i didn't wanted that behavior. And i can't disable that behavior with option showOnLoad:false (and false is default as i saw)..Other method works as expected. With other method when page loads i see a grid view, modal is not poping up and i can control whether i want it to be shown when page is loaded with showOnLoad. I assume that result should be the same with both methods...

tonytomov commented 6 years ago

No it is not the same. If you use navigator with showOnLoad false you should click the the button to lunch the search. If it is true it is loaded when page loads.

If you call searchGrid it is called on page load. If you do not want this behaviour you should attach a button and call this method. The option showOnLoad is available only in navGrid and not in searchGridd

With other words that are two diffrent method - navGrid create a button and call the searchGrid method internally.

I recommend you first to read the docs in order to see the diffrence: Basic search method http://www.guriddo.net/documentation/guriddo/javascript/user-guide/searching/#single-searching Navigator http://www.guriddo.net/documentation/guriddo/javascript/user-guide/navigating/#navigator

BogMil commented 6 years ago

Thanks for clearing things...