tonytomov / jqGrid

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

Can not set default options for navGrid #921

Closed BogMil closed 4 years ago

BogMil commented 6 years ago

When i console $.jgrid, there is no nav property. So i can not set options for navGrid globally as suggested here: https://stackoverflow.com/questions/19538012/jqgrid-default-refresh-button-to-refresh-current-page

Also there is no properties like add or edit defined in docs: http://www.trirand.com/jqgridwiki/doku.php?id=wiki:navigator

But, for example, i have defaults property, where i can set default values, that is documented here: http://www.trirand.com/jqgridwiki/doku.php?id=wiki:options#setting_options_globally

tonytomov commented 6 years ago

The documentation you refer is for the jqGrid <=4.7

It is highly recommended to read the new documentation here: http://www.guriddo.net/documentation/guriddo/javascript/

As from the higher versions you can query the values from language file: var nav = $.jgrid.regional["en"].nav;

in case you use English language file.

Please read carefully the new docs.

Kind Regards, Tony

BogMil commented 6 years ago

Yes, but it is regional file. For example, I want for all my navGrid to set refresh:false. Is it possible to set false as default value for refresh?

Thanks for quick answering!

tonytomov commented 6 years ago

I do not see a problem to do something like this:

<head>
    <script type="text/ecmascript" src="...jquery.jqGrid.js"></script>
    <script type="text/ecmascript" src=".../i18n/grid.locale-en.js"></script>
    ...
    <script>
        $.jgrid.regional["en"].nav.refresh = false;
     </script>

</head>
BogMil commented 6 years ago

Works. Thanks!