I’m using dhtmlx ver 4.6 and have downloaded the PHP connectors from the link given in the dhtmlx website. I’m unable to populate the tree using the connector. The details of my environment are as follows:
OS: Windows 8.1
PHP version: 5.x
DHTMLX ver: 4.6
Connector Source: dhtmlxConnector_php_v15_120612
Database: Postgresql ver 9.4
My PHP Script for generating the XML for the tree is failing with the output: “”
My PHP Script used for generating the required XML for loading is:
$res=pg_pconnect("host=localhost port=5432 db=ednsys user=ednsys password=ednsys");
$gridConn = new TreeConnector($res,'Postgre');
The file paths in the “require” part of the PHP are all correct.
Find attached the required screenshots so that you get a correct idea. The table structure, the data in the table, my PHP code and the browser screenshots are attached in the slide 1 to slide 4 respectively. I should be getting a nice hierarchy tree of all the departments, instead get the output ".
Do tell me where I’m going wrong.
Thanks and Regards
The connector expects that top level records will have par_org_type as “0”. In your case the top level record (University) just have an empty par_org_type field. Just change that value to “0” and connector will work correctly.
I’ve performed the necessary action. I added a “root record” with id=0 and also the parent id =0.
It still doesn’t work. See the data changes I’ve made. Kindly suggest a solution.
Thanks much in advance.
Manish Kumar Deshpande
With such data, as on the last screenshoot, code must work correctly
Please try to enable logs
$gridConn = new TreeConnector($res,‘Postgre’);
Log file will contain info about errors ( if you have any ) and exact SQL code executed by the connector.
The code works fine and the problem was due to some unprintable characters in the PHP file that came in the way. I don’t know how. I’ve re-written the PHP file in a new editor and on execution, it works fine. Thanks for your guidance and support.