:: Forum >> Version 1 >>

Grid Refresh Error.

Hi,
I am dynamically adding new row in the grid. I add row to XML datasource, update the row count property of grid object. New row is successfully added to the grid.

Now for refreshing the grid, I call request method of Active.XML.Table object and then call refresh method of the grid.
I get error in refresh function of grid.
obj.refresh=function(){try{var element=this.element();if(element){element.outerHTML=this.toString()}}catch(error){this.handle(error)}}
The bold part of the code in refresh function gives me the error. Error message is "null is null or not an object". This is for "toString()"

My Code is<script>
var 
table = new Active.XML.Table;
   
table.setURL("companies-simple.xml");
   
table.request();   
 var 
obj = new Active.Controls.Grid;
 
obj.setModel("data"table);
    
document.write(obj);
<
script>

function 
AddRow()
{

    var 
dataXmlDoc obj.getDataProperty('XML');
    var 
rootNode dataXmlDoc.documentElement;
    var 
newRow dataXmlDoc.createElement"company" );
   
   
   var 
colName dataXmlDoc.createElement"ticker" ); 
   
newRow.appendChild(colName);
   
   var 
colName dataXmlDoc.createElement"name" ); 
   
newRow.appendChild(colName);
   
   var 
colName dataXmlDoc.createElement"mktcap" ); 
   
newRow.appendChild(colName);
   
   var 
colName dataXmlDoc.createElement"sales" ); 
   
newRow.appendChild(colName);
   
   var 
colName dataXmlDoc.createElement"employees" ); 
   
newRow.appendChild(colName);
    
    
rootNode.appendChild(newRow);
    
obj.setRowProperty("count"rootNode.childNodes.length);  
    
obj.refresh(); 
}

 
Can any one please help me? Thanks in advance.
Rajeev
Monday, June 2, 2008
Solved using /javascript.forum.1788.29/bug-caused-by-sorting.html
Rajeev
Friday, June 6, 2008



This topic is archived.

Back to support forum

Forum search