1

I have a situation where when I am doing inline editing, I like a field called "Service" to be set to where editable is false.

When I click on the add new record icon (the one that comes with jqGrid), I like to set the editable to yes for the "Service" field. How can I do this dynamically?

I checked online but was not able to find a suitable answer.

Nate Pet
  • 44,246
  • 124
  • 269
  • 414
  • You can try dynamically changing the `editable` colmodel option, but this will affect all of the rows. I assume you only want the one row to be affected? – Justin Ethier Sep 12 '12 at 13:40
  • You should describe more exactly how you use inline editing. Do you use `inlineNav`? Do you use both "Add" and "Edit" buttons or only "Add"? Are the row always selected before the user click on "Add" button? A simple jqGrid which describe the problem could be helpful. Is "Service" is the name of the column or the text in the cell of the column? – Oleg Sep 12 '12 at 16:04

1 Answers1

0

The main idea of changing editable property dynamically I described here and here. It's important to understand that editable property exist only for the whole column, but you can change the value any time. So if you would change the value of editable property for some column before inline editing will be initialized (before editRow will be called directly or indirectly). You can use the approach to implement almost any dynamical scenario. Probably you will have to use custom navigator buttons instead of the standard buttons added by inlineNav (if you use the method).

In the answer and in another one I shown additionally how you can hide or disable some editing buttons depend on which row (or depend on the row content) is currently selected. It could be one option which could makes the editing more dynamic.

Community
  • 1
  • 1
Oleg
  • 220,925
  • 34
  • 403
  • 798