Closed Bug 192433 Opened 22 years ago Closed 22 years ago

getCellText only callable with column label not with column-index

Categories

(Core :: XUL, enhancement)

x86
Windows 2000
enhancement
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 121568

People

(Reporter: penning, Assigned: janv)

Details

User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.3a) Gecko/20021212 Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.3a) Gecko/20021212 To fill a custom treeview the function getCellText has to be called, it would be handy if the cell could be approached with a columm-index. A treerow could then be easier filled with a multidimensional array. Current method: treeView = ({ rowCount : tablearray.length, getCellText : function(row, col) { return getRowCellData(row,col); } }); function getRowCellData(row,col) { switch (col) { case "isbn" : cell = 0; break; case "author": cell = 1; break; case "title" : cell = 2; break; case "price" : cell = 3; break; } return tablearray[row][cell]; } Easier would be: treeView = ({ rowCount : tablearray.length, getCellText : function(row, col) { return tablearray[row][column-index]; } }); Reproducible: Always Steps to Reproduce: 1. 2. 3.
Um... JS supports multidimensional arrays indexed by strings. So you could do tablearray[row][cell] indexed by string. Alternately, you could name your columns '0', '1', etc... Just thoughts.
this is actually bug 121568 *** This bug has been marked as a duplicate of 121568 ***
Status: UNCONFIRMED → RESOLVED
Closed: 22 years ago
Resolution: --- → DUPLICATE
Component: XP Toolkit/Widgets: Trees → XUL
QA Contact: shrir → xptoolkit.widgets
You need to log in before you can comment on or make changes to this bug.