coll_options

Hi DHTMLX support !,

Imagine the XML is like this :

<?xml version="1.0" encoding="UTF-8"?> 1 1

And the load is like this, with a callback to onloadXML

gantt.load(“listage.asp”,“xml”, onloadXML);


How i can get data for coll_options/personnel_bet_off ? gantt.serverList doesn’t work.
I thought i can use a_array in javascript after.

function onloadXML(){

// var a_array = gantt.serverList("personnel_bet_off");

}


Please help :slight_smile:

Hello.

Before xml loading you should call serverList function, to create server list. Then you can use it as you want.
For example:

        gantt.attachEvent("onLoadEnd", function(){
            var array = gantt.serverList("personnel_bet_off");
            console.log(array);
        });

        gantt.serverList("personnel_bet_off");
        gantt.load("test.xml","xml");

:smiley:

It works beautifully !.
Damn this was hard for me to understand the need to do the important :

gantt.serverList(“personnel_bet_off”);

before the load …

and get after the data like this :

var array = gantt.serverList(“personnel_bet_off”);

Thank you very much.
:wink: