views:

231

answers:

2

Hello, I have two different jqGrids in the same page. In the first grid I've set custom functions for the add and edit buttons in the navigator bar, using the following code:

$.jgrid.nav.addfunc = 
                    function() {
                         $('#btninsreset').click();
                    };
$.jgrid.nav.editfunc =
                    function(id) {
                        editUscita(id);
                    };

In the second grid I'd like to have the default behaviour, but I get the same seetings as the first grid instead. How may I reset the navigator to the default settings for the second jqgrid? Thank you

+1  A: 

I'v done it: I simply have to set $.jgrid.nav.addfunc = null;

Alex
A: 

Setting of $.jgrid.nav.addfunc change the global settings, so you can not use this if you want to have two jqGrids on the same page. The easiest way to solve the problem is setting of addfunc and editfunc as parameters of the first grid:

jQuery('#grid1').jqGrid({
    // ...
    '#pager1'
}).jqGrid ('navGrid', '#pager1', {
                                  addfunc: function() {$('#btninsreset').click();},
                                  editfunc: function(id) {editUscita(id);}
                                 });
Oleg