3.2.0

Problems filling my grid

hi guys,

i have the following problem, i downloaded the new 2.0 beta and i have to say i like what i see ;). When i try to fill it with custom data it won't work.

standard is like this:

<script>
var obj = new AW.UI.Grid;
obj.setControlSize(400, 100);
obj.setCellText("cell");
obj.setHeaderText("header");
obj.setColumnCount(5);
obj.setRowCount(10);
document.write(obj);
</script>


This fills all the colums with the content "Cell"

i modyfied it like this:

<script>
var obj = new AW.UI.Grid;
obj.setControlSize(526, 100);
obj.setCellText (["1","2", "3", "4", "5"]);
obj.setHeaderText("header");
obj.setColumnCount(5);
obj.setRowCount(5);
document.write(obj);
</script>


this works but when i try to add a new lines like this :

obj.setCellText (
["1","2", "3", "4", "5"],
["2","2", "3", "4", "5"],
["3","2", "3", "4", "5"],
["4","2", "3", "4", "5"],
["5","2", "3", "4", "5"]);


it won't work.. does anyone have any suggestions
seB
November 14,
You just need to reasign "RowCount" ( initially 1 and later 5) and then refresh the grid.
HTH

var obj = new AW.UI.Grid;
obj.setControlSize(526, 100);
obj.setCellText (["1","2", "3", "4", "5"]);
obj.setHeaderText("header");
obj.setColumnCount(5);
obj.setRowCount(1);
document.write(obj);

var but1 = new AW.UI.Button;
but1.setControlText("Button");
but1.setControlImage("favorites");
document.write(but1);
    
but1.onControlClicked= function(event){ 
obj.setCellText (["1","2", "3", "4", "5"],
["2","2", "3", "4", "5"],
["3","2", "3", "4", "5"],
["4","2", "3", "4", "5"],
["5","2", "3", "4", "5"]);

obj.setRowCount(5);
obj.refresh();
};
Carlos
November 14,
Uppps , there is some "typo" in your code, as 2 dimensional arrays need aditional ([]), so should be:
obj.setCellText ([["1","2", "3", "4", "5"],
["2","2", "3", "4", "5"],
["3","2", "3", "4", "5"],
["4","2", "3", "4", "5"],
["5","2", "3", "4", "5"]]);
Carlos
November 14,
Thnxx alot, :)
It works fine now!
seB
November 14,

This topic is archived.

See also:


Back to support forum