2

I have been going through the jqGrid wiki and havent been able to find a couple of things. Maybe its too customized.

1) Is it possible to have jqGrid display all fields of the row when editing via form edit but in the form only few fields are editable? I want users to see all the details about the row while they are editing just one part of it.

2) I also want to remove the left/right nav arrows on the form edit window.

Thanks!

PiTheNumber
  • 22,828
  • 17
  • 107
  • 180
stackErr
  • 4,130
  • 3
  • 24
  • 48

1 Answers1

1

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.

Community
  • 1
  • 1
Oleg
  • 220,925
  • 34
  • 403
  • 798
  • actually this works pretty well for my first problem: editable: true,editoptions: {disabled:'disabled'} just found it through the example in your post [link](http://stackoverflow.com/a/6974432/315935) @Oleg – stackErr Feb 08 '12 at 11:18