:: Forum >>

Add New Row at Top

Hi All,

I am trying to add new row in grid dynamically. I have followed standard way as found in forum ie adding new row data.
var table = new Active.XML.Table;
var obj = new Active.Controls.Grid;
obj.setModel("data", table);
function AddRow()
var dataXmlDoc = obj.getDataProperty('XML');
var rootNode = dataXmlDoc.documentElement;
var newRow = dataXmlDoc.createElement( "company" );
[b] rootNode.insertBefore( newRow, rootNode.firstChild);
obj.setRowProperty("count", rootNode.childNodes.length);

I have tried both appendChild and insertBefore as put in bold letters above.
But new row is always added to BOTTOM instead desired at TOP.

I have also tried what was suggested by Alex in http://www.activewidgets.com/javascript.forum.945.3/changing-rows-urgent.html

Doing so give me error in refresh function of grid.

Does anyone solution for this.

Monday, June 9, 2008

This topic is archived.

Back to support forum

Forum search