3.0.5

myData array question with 2.0 beta version

Was testing out the beta version and loaded the myData array just like I did on the old one (which worked fine). But this one loads it with the each complete array into each cell.

When I alert myData[0] to check the first array it comes up as AAA,BBB,CCC

But when I write the grid it put AAA,BBB,CCC in the first column and AAA,BBB,CCC in the second column and AAA,BBB,CCC in the third. Instead of AAA in the first, BBB in the second, and CCC in the third.

What is different from the first release of Active Widgets and the new 2.0 Beta version as far as the myData array is concerned?
Anthony
October 3,
In 2.0 you can simply assign 2-d array to cell text property:

obj.setCellText(myData);	// 2-dimensional js array


or you can assign data row-by-row

obj.setCellText(myRow, 1);	// js array, only row-1


or single cell

obj.setCellText("text", 2, 3);	// col-2, row-3


You can also supply data with a function (as before):

obj.setCellText(function(c, r){return myData[r][c]});


but in this case the arguments are column, then row (was row, column before).

You can also assign 'data source' function to only one column or even single cell.

Alex (ActiveWidgets)
October 3,
Thanks!
Anthony
October 3,

This topic is archived.

See also:


Back to support forum