I am trying to upgrade from 3.6 to 4.0.2 and getting error:
Uncaught TypeError: Cannot read property ‘getElementsByTagName’ of null. Below is an image of the error in chrome debugger. The error is because the parameter E is null.
This error only occurs when calling combobox.load(‘url’).
Here is my code
comboTranTree = new dhtmlXCombo("TranTree", "tranTree1", 150);
comboTranTree.load("pagevrd.vrd?session=9zbr0zvt51rj9pqj26uzdad6gidy0adw&page=glreport&reportCode=TTEXP&formAction=getData&reportDate=31/03/2014&accountFilter=&excludeZero=false&tCode=&tranTree1=&reportBudget=&publishedReportOid=&combo=tranTree1");
The xml returned from my url looks like this:
Contract
Salesperson
Site
TT multi level
When using v3.6 with the old loadXML method, the above code works perfectly.
Is there something I am missing or is this a bug within 4.0.2?
The link is: link to PRO version was saved and deleted
Click on “Click here for a Demo Login”.
Click on “e-Computers - NZ”
Click on Show Menu(Top Left), General Ledger, Financial Reports, Management Reports,Tran Tree Expenses.
On this page there is 3 comboboxes, the first one (“All Levels”) is using dhtmlXComboFromSelect which is working fine. The second one calling the code below, which is causing the error.
comboTranTree = new dhtmlXCombo("TranTree", "tranTree1", 150);
comboTranTree.load("pagevrd.vrd?session=ff0agk3o9ta96mceqbxm327d68vaxaio&page=glreport&reportCode=TTEXP&formAction=getData&reportDate=31/03/2014&accountFilter=&excludeZero=false&tCode=&tranTree1=&reportBudget=&publishedReportOid=&combo=tranTree1",function(){
// callback
});
The link in the load method can be pasted into the url and will give you the xml.
link to PRO version was saved and deleted
Thanks
could you please take only 1 combo, take xml for it, create completed demo where it will not work as on your site and send us this demo to support@dhtmlx.com?
This solution doesn’t work for me.
I have just d/l the std 4.3 and have updated my sources to comply with this version (mostly removing obsolete functions and changes in loading).
Whatever I do I keep getting this error.
Which worked fine with version 3.5
XML is the same, headers are ok, all the tags are there.
Menu’s and XML-files still work but getting the XML from the server gives this error.
If I look at the dhtmlx-code it seems it can’t find the ‘complete’ tag, which is definitely there !
A complete example would be difficult since there are a lot of components involved.
This is a full-blown application and it worked with 3.5…
I’m currently looking into the headers again.
What I’ve tried now (and is working) is to do a ajax.get and pass the responseText to the load function of the comboBox.
Note the Text part because it looks like the combo.load doesn’t get the data in the responseXML part of the reply !
PHP generates the data and it’s definitely setting the header and the xml-tag in the data.
So either I’m missing something obvious or somehow the data is not parsed into the ReponseXML.
For others having similar problems :
The “fault” was in the php header command.
This is what worked with 3.5 :
header(“Content-type: text/xml”);
This is what it has to be in 4.3 :
header(“Content-Type: text/xml”);
The difference is that it needs to be a capitol T !
This may be something to allow in dhtmlx : accept any way of writing of the header.
Examples on the internet wrt content-type use different casing :
content-type
Content-type
Content-Type
is all the same, but not for dhtmlx !
Thanx for responding, if I got it all working we’ll upgrade to the Pro version (again) !