:: Forum >>

AddRow() when fails datasoure is empty

When the grid is empty, the function AddRow() doesn't work properly and values are not correct . Any idea?

Thanks in advance, Here is a sample of code:

var myData = [];
var myColumns = ["Col1", "Col2"];

var grid = new AW.UI.Grid;
grid.setId("myGrid");
grid.setCellText(myData);
grid.setHeaderText(myColumns);
grid.setRowCount(0);
grid.setColumnCount(2);

grid.refresh();

function add(){
var num_rows = grid.getRowCount();
num_rows++;
myData[num_rows] = ['',''];
grid.addRow(num_rows);
}
Marc
Friday, October 30, 2009
Shouldn't it read ... var myData = [[]]; ??

Friday, October 30, 2009
function add(){
var i = myData.length;myData[i] = ["",""];
grid.addRow(i);
grid.setCurrentColumn(0);
grid.refresh();
setTimeout("grid.element().focus();",200);
}
thierry
Saturday, October 31, 2009
OK, it works! Thanks.
Marc
Sunday, November 1, 2009

This topic is archived.


Back to support forum

Forum search