var sdc = dhtmlXComboFromSelect("sdc");
sdc.loadXML("xml/combo/sdc.xml");
sdc.readonly(true);
// to init combo
sdc.selectOption(0);
sdc.enableFilteringMode(false);
sdc.attachEvent("onChange", doChange);
The function selectOption is running pretty good if I double click html file to open it in IE.
url is: D:\demo\web\dm_edit.html
But if I access html file in Tomcat or Weblogic, this function is not excuted. When page loaded,the combo is blank.
url is: localhost:8080/demo/dm_edit.html
Also, I use dhtmlXTree like:
var tree = new dhtmlXTreeObject("treeObj", "100%", "100%", 0);
tree.setSkin('dhx_skyblue');
tree.setImagePath("icon/tree/");
tree.loadXML("xml/tree/project01.xml");
tree.setOnClickHandler(doSelect);
In Tomcat or Weblogic,when page open, the function doSelect(defined by myself) is automatically excuted.
Unless I use setOnDblClickHandler(doSelect), doSelect is not excuted.
But if double click html file to open it in IE, all become well. Both using setOnClickHandler and setOnDblClickHandler, doSelect is not automatically excuted when page open.
Tomcat version is 5.5 and 7.0.35
Weblogic version is 12
Data loading is async by default ( but when loading by file:// it is always sync ) , so you need to move after-init code to loading callbacks, like next