Adds the new row to the grid.
addRow()
method inserts the index of the new row at the end of the row indices array and adds the row html to the display without full grid refresh.
addRow()
method does not add the row to the datasource - you should first add the row to the datasource and then update the grid with addRow(index)
passing the index of the new row as an argument.
This method triggers onRowAdding and onRowAdded events.
nullobj.addRow(index);
index (string/number) - index of the new row in the datasource
var myData = [
["row 0", 0]
]
var obj = new AW.UI.Grid;
obj.setCellData(myData);
obj.setColumnCount(2);
obj.setRowCount(1);
document.write(obj);
function addRow(){
// calc new row index
var i = myData.length;
// add row to the datasource
myData[i] = ["row " + i, i];
// update grid
obj.addRow(i);
}
Currently it is not possible to insert the new row in the middle of the grid - it is always added as a last row.