We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Treeview with PHP

Thread ID:





126224 Oct 2,2016 09:30 PM UTC Oct 10,2016 11:52 AM UTC JavaScript 3
Tags: ejTreeView
Ahmed Lazreg
Asked On October 2, 2016 09:30 PM UTC

I'm using Treeview with a PHP application. I was filling the datasource using local data generated via PHP. I want to know how can I use a php ajax call to serve as datasource?
There is no documentation about that. Must I create an oData compatible source? or is it possible to have a simple php script generating JSON data to build the tree?
Any example is very appreciated.
Thank you


Piramanayagam Ramakrishnan [Syncfusion]
Replied On October 3, 2016 12:49 PM UTC

Hi Ahmed, 
Thanks for contacting Syncfusion support. 
We have analyzed your query. We would like to inform you that, TreeView is compatible with local data source and OData service.  
For local data-source binding: 
We can decode the JSON data using json_decode method and assign to TreeView control. Please refer the below code example, 
$Json = json_decode(file_get_contents("Data.json"), true); 
$treeview = new \EJ\TreeView("localData"); 
$fields = new EJ\TreeView\Field(); 
echo $treeview->fields($fields)->render(); 
For your reference, we have prepared the TreeView sample with JSON data in the below link: Sample 
OData Service: 
We can also provide the OData service to TreeView control, please refer the below code example, 
$dataManager = new \EJ\DataManager(); 
$query = new \EJ\Query(); 
$child = new \EJ\TreeView\Field(); 
$treeview = new \EJ\TreeView("remoteData"); 
$fields = new EJ\TreeView\Field(); 
echo $treeview->height("300px")->width("300px")->fields($fields)->render(); 
We have live demo sample for your requirement (TreeView with OData service). Please refer the below link: http://php.syncfusion.com/#Navigation/TreeView/remoteData.php 
Currently we are preparing the document for PHP platform. We will publish the document on or before 31th October 2016. 
Please let us know whether the provided sample is helpful in achieving your requirement. If not, get back to us with more information for us to assist you. 
Piramanayagam R

Ahmed Lazreg
Replied On October 7, 2016 04:36 PM UTC

thank you for your answer. But in your php example, you are using some set of classes that I cannot found in syncfusion source codes (EJ\Datatamanager for example). Where can we find this librarie of php classes?


Balamurugan P [Syncfusion]
Replied On October 10, 2016 11:52 AM UTC

Hi Ahmed, 
You can access the Syncfusion related PHP libraries from  Essential Studio package installed location that is available in your system.  
(installed location)\Syncfusion\Essential Studio\\Samples\PHP => SampleBrowser\EJ 
For example, If you have installed the Essential Studio package within C:\Program Files(x86), then navigate to the below location, C:\Program Files (x86)\Syncfusion\Essential Studio\\Samples\PHP => SampleBrowser\EJ 
Please let us know if you require any further assistance. 



This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon