Solution 1
prgramatic in javascript: use hideCol and give it a column name or a set of columns [colnames, otherone], the jqGrid object given by one name will hide this column with this name. Given the array colnames ["name1", "name2"], it will hide the columns with these names, 'name1' and 'name2', in the example. Names in colname or colnames must be valid names from colModel. Remember that this will not change the width of the column, so you still have to change the colModel example:
colModel :[{name:'photo', index:'photo', width:605, sortable:false} ,... ]
<script> jQuery("#grid_id").setGridParam({...}).hideCol("photo").trigger("reloadGrid"); </script>
solution 2: solution 1:
jQuery(document).ready(function(){ jQuery("#list").jqGrid({ url:'json.php?myfilter=columnname', datatype: 'json',//or xml? mtype: 'GET', //<!--important colNames:['Banner','name', 'city','state','Zip Code','Country'], colModel :[ {name:'photo', index:'photo', width:605, sortable:false} ,
then in json.php you can extract the column key from the array before printing it
Neo
source share