Author Topic: Getting colModel title  (Read 2651 times)

bsolteam

  • Pro Deluxe
  • Full Member
  • *
  • Posts: 107
    • View Profile
Getting colModel title
« 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.
« Last Edit: July 31, 2014, 01:00:00 pm by bsolteam »

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6310
    • View Profile
Re: Getting colModel title
« Reply #1 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;