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
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));
});
Thanks, a lot for this. After 2 days of googling at long last got the solution