I had these working great as navgrid settings like follows:
this.Grid.navGrid('#' + this.PagerId, {}, {}, {}, {},
{
closeAfterSearch: true,
closeAfterReset: true,
closeOnEscape: true
});
but I would like them to be set as defaults.
I tried:
$.extend($.jgrid.defaults, { search : { closeAfterReset: true } });
$.extend($.jgrid.search, { closeAfterReset: true } );
...and neither seem to be working. Any tips?
EDIT:
Here is my code as @Oleg suggested - still not working:
$.extend($.jgrid.search, {
closeAfterSearch: true,
closeAfterReset: true,
closeOnEscape: true,
beforeShowSearch: function ($form) {
...
},
onClose: function (searchBoxId) {
...
},
Reset: "Clear Filter",
Find: "Filter Grid"
});
According to the single_searching article on the jqgrid wiki, search options are set here, which is why I did my original code:
<script>
...
jQuery("#grid_id").jqGrid({
...
pager : '#gridpager',
...
}).navGrid('#gridpager',{view:true, del:false},
{}, // default settings for edit
{}, // default settings for add
{}, // delete instead that del:false we need this
{search_options}, // search options
{} /* view parameters*/
);
...
</script>
The funny thing to me is that my onClose
and beforeShowSearch
events are being hit, but the properties are having now affect...