jqGrid has a lot of features and it's really not easy to find the feature which corresponds your requirement.
First I answer on you second question. The method editGridRow has the option viewPagerButtons which can be used to hide the navigator arrows on the Add/Edit forms. In the most common case if you use navGrid to enable form editing you should include viewPagerButtons: false
as the property of the prmEdit
and prmAdd
parameter of navGrid
. You can consider to change the default settings of the form editing by the usage of
$.extend($.jgrid.edit, {viewPagerButtons: false});
I personally changes defaults in all real projects which uses jqGrid. I include many changes of jqGrid defaults in one JavaScript file and include it in the master page directly after jquery.jqGrid.min.js
. See more about jqGrid settings . The usage of $.jgrid.defaults
, $.jgrid.nav
$.jgrid.edit
, $.jgrid.del
, $.jgrid.search
, $.jgrid.view
, $.jgrid.inlineEdit
, $.jgrid.ajaxOptions
could not only reduce the code for creating of every grid which you use. It can simplify the manage of common project settings and improve the maintenance of the software development project.
To your first question: I understand good the problems which you describes. In one my old post I
described some suggestions how to extend the current features of jqGrid to implement your requirements too. It's a pity, but such features are still not in jqGrid. Nevertheless you can use the tricks described here, here, here and here. You should understand that the changes which you make in colModel
inside of beforeInitData (like making a column editable, hidden or any other changes) will be directly used during constructing of the form. The most comfortable you can change colModel
with respect of setColProp method. Already inside of beforeShowForm or afterShowForm callbacks you can reset the column properties of colModel
in the initial state.