How to add a new row in a Grid using xml data.
Hi Anybody please let me know how to add a row into the Grid which uses xml data.
I'm using Active.XML.Table to load my grid initially from a XML string.
It works fine. I'm trying to add a new row into the grid . In someother thread Alex mentioned that, use table.request() method. And this will trigger the grid's refresh method. So i tried as like this.
function new_row()
{
table.request();
setTimeout("new_row()",3000);
}
<a href="javascript:new_row()">New Row</a>
But it generates error.
Error: uncaught exception: [Exception... "Component returned failure code: 0x80070057 (NS_ERROR_ILLEGAL_VALUE) [nsIXMLHttpRequest.open]" nsresult: "0x80070057 (NS_ERROR_ILLEGAL_VALUE)" location: "JS frame :: http://192.168.1.21/x_cscripts/grid.js :: anonymous :: line 40" data: no]
Can anybody pls help me in this regard. If possible post some code here. that would be useful to me.
I tried like this also
obj.setRowProperty("count",obj.getRowProperty("count")+1);
var cnt = obj.getRowProperty("count")
table.setText('test',cnt, 0);
table.setText('test',cnt, 1);
table.setText('test',cnt, 2);
table.setText('test',cnt, 3);
table.setText('test',cnt, 4);
obj.refresh();
But i cannot achieve the expected.
Thanks in advance,
I'm using Active.XML.Table to load my grid initially from a XML string.
It works fine. I'm trying to add a new row into the grid . In someother thread Alex mentioned that, use table.request() method. And this will trigger the grid's refresh method. So i tried as like this.
function new_row()
{
table.request();
setTimeout("new_row()",3000);
}
<a href="javascript:new_row()">New Row</a>
But it generates error.
Error: uncaught exception: [Exception... "Component returned failure code: 0x80070057 (NS_ERROR_ILLEGAL_VALUE) [nsIXMLHttpRequest.open]" nsresult: "0x80070057 (NS_ERROR_ILLEGAL_VALUE)" location: "JS frame :: http://192.168.1.21/x_cscripts/grid.js :: anonymous :: line 40" data: no]
Can anybody pls help me in this regard. If possible post some code here. that would be useful to me.
I tried like this also
obj.setRowProperty("count",obj.getRowProperty("count")+1);
var cnt = obj.getRowProperty("count")
table.setText('test',cnt, 0);
table.setText('test',cnt, 1);
table.setText('test',cnt, 2);
table.setText('test',cnt, 3);
table.setText('test',cnt, 4);
obj.refresh();
But i cannot achieve the expected.
Thanks in advance,
Kumar S
September 13,