<sjg:gridColumn name="progressivo" index="progressivo" title="ID" sortable="false" formatter="integer" width="40" displayTitle="false" editable="true" hidedlg="true" editrules="{edithidden:false}"/>
I do NOT want to be able to edit the field, I do NOT want to show it in the edit Dialog, but I want to pass it to the action. My understanding is that I should use editable="true", hidedlg="true", editrules="{edithidden:false}" as specified above. But the field is still visible and editable in the dialog... anyone knows what is wrong with this code? thanks
I don't see hidden="true"
in the list of attributes of <sjg:gridColumn ...>
. Moreover you use editrules="{edithidden:false}"
instead of editrules="{edithidden:true }"
. Probably it's the problem.
In other words you need to have the column properties
hidden: true, editable: true, editrules: { edithidden: true }, hidedlg: true
described in the answer for example.
I think you have two options. I personally handled this requirement by defining my own custom edit options.
Ex:
... editable: true, edittype: 'custom', editoptions: { custom_element: readOnlyTextBox, custom_value: readOnlyTextBoxValue } ... function readOnlyTextBox(value, options) { var el = document.createElement("input"); el.type = "text"; el.value = value; el.disabled = true; // "disabled"; return el; } //function readOnlyTextBox(value, options) { function readOnlyTextBoxValue(elem, operation, value) { //console.log('Elem: ' + elem + ' Operation: ' + operation + ' Passed Value: ' + value + ' Value: ' + $(elem).val()); if (operation === 'get') { return $(elem).val(); } else if (operation === 'set') { $(elem).val(value); } } //function readOnlyTextBoxValue(elem, operation, value) {
The other option would be to define your own edit form handler and pass in the extra row item value:
.... ondblClickRow: function (rowid) { EditCollectionItem(rowid, this) }, //ondblClickRow .... function EditCollectionItem (rowid, grid){ $(grid).jqGrid('editGridRow', rowid, { viewPagerButtons: false, editData: { ExtraDataKey: ExtraDataValue }, afterShowForm: function (formid) { }, //afterShowForm afterComplete: function (response) { } //afterComplete }); //$this.jqGrid('editGridRow }//function EditCollectionItem (rowid, grid){