I am using form edit in jqgrid. The grid has additional non-editable columns which are visible. On form editing, these fields are not to be shown but still need to be posted to server.
Any help is appreciated.
If you need to send additional information about non-editable columns which are visible I would recommend you to use onclickSubmit callback. The callback can return object which can be used to extend the data which will be send to the server on form submit. For example the following onclickSubmit
implementation
onclickSubmit: function () {
return {
test: "bla bla"
};
}
extend the standard data sent to the server with parameter test
which value will be set to the string "bla bla"
.
You can do for your purpose the following:
onclickSubmit: function (options, postdata) {
var rowid = postdata[this.id + "_id"]; // like "list_id"
return {
myParam: $(this).jqGrid("getCell", rowid, "colName")
};
}
where "colName"
is the value of name
property of the column which you need to send.
Such approach seems to me very simple and flexible enough.
or u can set editable false in jqgrid colModel property
{ name: 'pID', index: 'pID', width: 50, editable: false, sortable: false }