setCellText method used can cause setCellText by col to FAIL
In almost all of Alex's demos he uses the obj.setCellText( function...) method to read (or generate) the initial sell settings. I noticed that almost every time I tried the very same demos, or something like it, the code would FAIL. It turns out (as least I think unless I'm doing something really wrong ) that:
If you use:
obj.setCellText(function(c,r){return myData[r][c]} );
Then Column "setCellText('"newtext",1) will work fine.
BUT if you use:
obj.setCellText(myData);
Then either a function type or simple "setCellText('"newtext",1) will not work.
Here is a full tiny example where you can choose by comment the type of set cell set: ( 2.0RC1 )
Can some one confirm this? (or tell me gently what I'm doing wrong?
I think a lot of people noticed this when they tried Alex's beautiful checkbox demo. Where setting by column is common. But no where, could i find the reason. If this is a well know bug, could some one point to the description?
thanks everyone
-geoff
If you use:
obj.setCellText(function(c,r){return myData[r][c]} );
Then Column "setCellText('"newtext",1) will work fine.
BUT if you use:
obj.setCellText(myData);
Then either a function type or simple "setCellText('"newtext",1) will not work.
Here is a full tiny example where you can choose by comment the type of set cell set: ( 2.0RC1 )
Can some one confirm this? (or tell me gently what I'm doing wrong?
<html><head>
<script src="runtime/lib/aw.js"></script>
<link href="runtime/styles/xp/aw.css" rel="stylesheet"></link>
</head> <body>
<script>
var myData = [
["aa","USPS ","0","9"],
["bb","Email","1","9"],
["cc","FedEX","2","9"],
["cc","FedEX","2","9"],
["dd","Phone","1","9"]
];
var obj = new AW.UI.Grid;
// ******* SIMPLY comment one way of reading data and put in the other!!!
// ******* NOTE: complete array method Makes Setting TEXT by column NOT work!
obj.setCellText(function(c,r){return myData[r][c]} );
//obj.setCellText(myData);
obj.setColumnCount(3);
obj.setRowCount(5);
obj.setCellText("ColumnSET",2);
obj.setCellText("singleSET",2,2);
obj.setCellText("ColumnSET",0);
obj.setCellText("singleSET",0,2);
document.write(obj);
</script>
</body>
</html>
I think a lot of people noticed this when they tried Alex's beautiful checkbox demo. Where setting by column is common. But no where, could i find the reason. If this is a well know bug, could some one point to the description?
thanks everyone
-geoff
G. Cayman
February 10,