hi~
after loaded, i got the json data with dataModel.url..
i want to add more Column with this json data key..
var grid;
$(function () {
colM = new Array();
colM.push({title: "all", align: "center", dataIndx : 'sAll', type:'checkbox', dataType: 'bool', cb: {all: true, header: false},editable: true});
colM.push({title: "subject", align: "center", dataIndx: "subject"});
colM.push({title: "help", align: "center", dataIndx: "help"});
colM.push({title: "id", align: "center", dataIndx: "id"});
pqGridObj.colModel = colM;
pqGridObj.pageModel.type = null;
pqGridObj.height = nowHeight();
pqGridObj.toolbar = null;
pqGridObj.dataModel.url = "auth_ori.run";
pqGridObj.dataModel.recIndx = "id";
pqGridObj.dataModel.getData = function (response) {
if (response.data.length>0){
var dataObj = Object.getOwnPropertyNames(response.data[0]);
for(i=0;i<dataObj.length;i++) {
if(dataObj.indexOf("admin_")>=0) {
colM.push({dataIndx: dataObj, title: dataObj.split("_")[2], type: 'checkbox', dataType: 'bool', cb: {header: true, all: true}, editable: true});
>>>>>>>>>>>>>>> column read data.......but, did not create checkbox, title, and title_checkbox.....
}
}
}
grid.colModel = colM;
return { data: response.data };
};
grid = pq.grid("#grid_json_scroll",pqGridObj);
})