I am trying to add colums dynamically (I have some nested ones) and it doesn't seems to be working.
What I am doing wrong?
function addWklyOtWO() {
var woItm = {title:"<b>2</b>", minWidth:50, dataIndx: "num2", resizable: false, align:"center",
colModel:[
{title:"<b>WO#</b>", minWidth:100, dataIndx: "woNo2", resizable: false, align:"center", cls:'Start-DayBorder',hidden:true},
{title:"<b>Units</b>", minWidth:40, dataIndx: "unts2", resizable: false, align:"center",hidden:true},
{title:"<b>Task#</b>", minWidth:40, dataIndx: "tsk2", resizable: false, align:"center",hidden:true},
{title:"<b>Ord Hrs</b>", minWidth:40, dataIndx: "ord_hrs2", resizable: false, align:"center",hidden:true},
{title:"<b>Veh</b>", minWidth:40, dataIndx: "veh2", resizable: false, align:"center",hidden:true},
{title:"<b>Veh Hrs</b>", minWidth:40, dataIndx: "veh_hrs2", resizable: false, align:"center",hidden:true},
{title:"",dataIndx:"vcRecId2",hidden:true},
{title:"",dataIndx:"lcRecId2",hidden:true}
]};
var otColMdl = $("#grid_wkly_ot").pqGrid("option", "colModel"),
woColMdl = otColMdl[0].colModel;
woColMdl.push(woItm);
$("#grid_wkly_ot").pqGrid("option", "colModel", otColMdl);
$("#grid_wkly_ot").pqGrid("refresh");
}