Hide column and show field when editing or add to jqGrid

I have more colimns in jqGrid. therefore, you need to hide some columns (fields) in jqGrod. When we edit or add, we need to show all fields in jqgrid to popup or add popup. So is there any property for this.

The code:

$("#Datasourcegrid").jqGrid({ postData: { CAId: function () { return $('#hdnchnAppId').val(); } }, colNames: ['DataSourceId', 'Title','Sort Order'], colModel: [ { name: 'DataSourceId', index: 'DataSourceId', align: 'left', key: true, editable: false, hidden: true, search:false,width: '10'}, { name: 'DataSourceTitle', index: 'DataSourceTitle', sortable: true, align: 'left', width: '400',editable: true, edittype: 'text', editrules: { required: true },stype:'text', search:true,searchoptions:{sopt:['eq']}}, { name: 'SortOrder', index: 'SortOrder', sortable: true, align: 'left', width: '100',editable: true, hidden: true, edittype: 'text', editrules:{number:true, required:true}, search:false}, ], 
+4
source share
1 answer

You can add edithidden:true to the editrules of the hidden: true column, see the jqgrid wiki in the editrules section for more options.

+5
source

Source: https://habr.com/ru/post/1498702/


All Articles