3.2.0

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
October 30,
Shouldn't it read ... var myData = [[]]; ??

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

This topic is archived.

See also:


Back to support forum