this.Grid = this.ListaLayout.items[0].attachGrid();
this.Grid.setImagePath(imagePath);
/* Struttura */
this.Grid.load("xml/" + this.Name + "_grid.xml");
this.Grid.attachEvent("onRowDblClicked", function(rId,cInd)
{
this.MyForm.load("php/connector/" + this.Name + "form.php?id=" + this.cells(rId,0).getValue());
this.MyTabbar.setTabActive("dati");
}
);
this.Grid.init(); <--- here the problem
this.Grid.load("php/connector/" + this.Name + ".php");
I’m trying to load the grid struct dinamically, then init the grid and after load the data in the grid. if i run the program in firebug everything works fine but not in normal run.
The problem is the init() call because it’s starts before the loading of the xml with the structure.
If you init grid structure from xml, you may not call init() method.
load() method works in asynchronous way, so next command will be called event if first is not finished yet. Work around is following:
Try to slide the scroolbar!
Yep, it was a dumb mistake from my side
The “docObj is null” error can appear if xml object is broken somehow
Try to modify your code as
this.Grid.methodName = function(value){
var grid = this;
window.setTimeout(function(){
grid.load("php/connector/" + value + "_grid.php");
},1);
};
It will ensure, that second xml will start loading only after existing one will be fully processed.