Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted on May 18, 2007 06:44
open dhtmlx forum
Some APIs are not working

Hi support,

I found that some of the APIs that are not working as they are supposed (according to your docs). I have the following code:

var mygrid = new dhtmlXGridObject(id);
mygrid.setImagePath("../imgs/");
mygrid.parseXML("bugreport.xml");
   
var count = mygrid.getColumnCount();
alert(count);
   
alert(mygrid.getHeaderCol(0));

The grid is coming out without any problem but it fails both the following function calls:

mygrid.getColumnCount();
mygrid.getHeaderCol(0);

Can you please tell me why this is happening?

Thanks in advance

Regards

Jayaprakash


Answer posted on May 18, 2007 09:57
The call to functions occured in moment when data not loaded yet.

The loadXML command is async, so the next command called after it can be
executed before XML really loaded and parsed in grid. To be sure that
XML already loaded you can use onLoadingEnd event or second parameter of
loadXML command.

grid.loadXML(someURL,function(){
//called after XML loaded
     alert(mygrid.getColumnCount());
     alert(mygrid.getHeaderCol(0));
});
Answer posted by Andrei (Support) on Dec 10, 2014 20:02

I hope this information will be enough for you. But you also can have a look at dhtml tree control and combo box in javascript.