You can implement your requirements in different ways. For example, inside the beforeShowForm event beforeShowForm you can hide or show
jQuery("#list").jqGrid({ colModel: [ { name: 'Name', width: 200, editable: true }, //... }).jqGrid('navGrid','#pager', { edit: true, add: true, del: false}, { // edit option beforeShowForm: function(form) { $('#tr_Name', form).hide(); } }, { // add option beforeShowForm: function(form) { $('#tr_Name', form).show(); } });
where id "tr_Name" is constructed from the tr_ prefix and "Name" is the name property of the column from colModel .
UPDATED : in and in another , one of the more ways to change properties can be shown dynamically immediately after editing is initialized.
UPDATED 2 : Free jqGrid allows you to define editable as a callback function or as "disabled" , "hidden" or "readonly" . See the wiki article . This makes it easier to implement the same requirements.
Oleg Aug 04 '10 at 13:28 2010-08-04 13:28
source share