:: Forum >>

Get Column Index by columnname

Hi there,

I like to now how i can get the column index by columnname.

What I would like to do is the following:
Based on the click of a row, select the value of a specific column (by column name) and pass that value to another function.

I need the index by columnname because of the functionality to re-order the columns.

Thanks in advance.

Nathan
Nathan
Monday, August 20, 2007
I am using the numeric position for that, but I would use something like:

function getColumnPosition(colName){ //or initial colNum pos
var columnPos ='';
for(x=0;x<Mycolumns.length;x++){
if(obj.getColumnIndices()[x]==colName){ // or == Mycolumns[colNum]
columnPos = x;
break;
}
}
return columnPos;
}
///(not tested)
Carlos
Wednesday, August 22, 2007
Uppsss, should be:

if(Mycolumns[obj.getColumnIndices()[x]]==colName){
// or
if(obj.getColumnIndices()[x]==colNum){
Wednesday, August 22, 2007

This topic is archived.


Back to support forum

Forum search