I have a jqgrid code as follows. I wanted to add a custom property to the colmodel same as myproperty in the code below.
...
jQuery("#list2").jqGrid({
url:'myurl',
datatype: "json",
colNames:['Inv No','Date', 'Client', 'Amount','Tax','Total','Notes'],
colModel:[
{name:'id',index:'id', width:55},
{name:'invdate',index:'invdate', width:90, myproperty:{prop1:'true', prop2:1}},
{name:'name',index:'name asc, invdate', width:100, myproperty:{prop1:'false', prop2:2}},
{name:'amount',index:'amount', width:80, align:"right"},
{name:'tax',index:'tax', width:80, align:"right"},
{name:'total',index:'total', width:80,align:"right"},
{name:'note',index:'note', width:150, sortable:false}
],
rowNum:10,
rowList:[10,20,30],
pager: '#pager2',
sortname: 'id',
viewrecords: true,
sortorder: "desc",
caption:"JSON Example"
});
jQuery("#list2").jqGrid('navGrid','#pager2',{edit:false,add:false,del:false});
The need for this is because I want to pass some properties to each column and get it later as follows. Lets say I want myproperty for row 1. I would do that
var rowId=1
var colmodel= jQuery("#list2").jqGrid('getGridParam', 'colModel');
var myProperty = colmodel[rowid].myproperty;