dwr 呼び出しは、任意の数の特定の列を持つ一連のデータを返します。たとえば、名前、ID、住所などです。アドレスは、最初のレコードの場合は address1、address2、2 番目のデータの場合は address1、address2、address3 のように、1、2、または 3 になります。私の質問は、jqgrid の列名を動的にする方法です。
DataHandler.fetch(function(data){
resultSet = data;
jQuery("#table1").jqGrid({
datatype : "local",
data : resultSet,
height : 250,
width : 978,
sortable : false,
ignoreCase : true,
sortorder : "desc",
colNames : ['Email Date/Time','User Name', 'Department'] //want to make this dynamic
colModel : [ {
name : 'mailedOn',
index : 'mailedOn',
width : '18%',
align : 'center',
}, {
name : 'userName',
index : 'userName',
width : '18%',
align : 'left',
sorttype : 'text',
}],
rowList:[10,20,30],
pager : '#pager',
rowNum : 10,
altRows : true,
altclass: "myclass",
viewrecords : true
});
});
何か助けて??