ParamQuery grid support forum

General Category => Help for ParamQuery Pro => Topic started by: bsolteam on July 31, 2014, 12:58:26 pm

Title: Getting colModel title
Post by: bsolteam on July 31, 2014, 12:58:26 pm
HI ParamQuery,

   I am using nested column. My code will be like this.
Code: [Select]
obj.colModel = [
            { title: "Name ",align:'left',width:200,halign:'center',align:'left'},
            { title: "Voyages",align:'center', width:250,
colModel:[{title:" UMS ",align:'center', width:250},
             {title:" DO",align:'center',width:250},
              {title:"GO",align:'center',width:350},
              {title:" MGO",align:'center', width:250}]},         
        ];
  Here i want to alert the title MGO. I used following code to alert the title.
Code: [Select]
var CM = $grid.pqGrid("option", "colModel");
 alert(CM[5].title)
But its throwing error. I can able to alert the name and voyages title. I can't able to alert the nested colmodel title.
Please provide some solutions for this.
Title: Re: Getting colModel title
Post by: paramvir on July 31, 2014, 02:09:55 pm
var CM = $grid.pqGrid( "option", "colModel" );
var title = CM[1].colModel[3].title;

or

var CM = $grid.pqGrid( "getColModel" );
var title = CM[4].title;