how to get the column header name in the javascript

I am loading all the grid header in the XMl itself

in the Javascript I want to get the header column position

for example in column header

no task name Level1 Level2 Level3

these are the headers in the DHTML Grid…

if I give the header name Level1 and how to get header position in the Javascript

Please help me in the situvation

Thanks and Regards


You can use next syntax in XML
    <column id=“level1” width=‘100’ type=‘ro’> Level1

And later in javascript
    var pos=grid.getColIndexById(‘level1’)

Thank you for your Information…


 If suppose the Headers are Dynamic one…

Can I  check whether the Column Header is Exists or Not…


For Example the Level is from 1 to 10

Suppose I check is Level11 is exists or not…

Please provide some solution for this.


You can get count of columns as

If you need to check existence of some column , you can use approach described above

  var pos=grid.getColIndexById(‘level11’)
  if (typeof pos == “undefined”) alert(" level11 doesn’t exists ");