Since you are using an example from my old answers ( this and this ), I feel that I should answer your question as well.
In the old example, all fields that can be changed while adding or editing dialogs have the editable:true property. Fields that should only be displayed in the Add dialog box will be hidden inside the beforeShowForm event descriptor . Similarly, we can temporarily switch some fields to editable:false before calling the editRow method and reset back to editable:true immediately after the call:
onSelectRow: function(id) { if (id && id !== lastSel) { grid.jqGrid('restoreRow',lastSel); var cm = grid.jqGrid('getColProp','Name'); cm.editable = false; grid.jqGrid('editRow', id, true, null, null, 'clientArray'); cm.editable = true; lastSel = id; } }
You can see this live here .
UPDATE: Free jqGrid allows you to define editable as a callback function. See the wiki article . It allows you to make a column editable in some rows and keep it uneditable for other rows.
Oleg Nov 29 '10 at 21:15 2010-11-29 21:15
source share