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. Image for the cookie policy date

Questions regarding to the ejTreeView

Hello syncfusion 
I have 3 questions 

1. Would it be possible to insert icons according to the level? 
2. when drag the node the parentId does not set in the getTreeData(), how do I add the parentId in the node? 
3. I am trying to use the contextmenu but can't figure out what "rename" method is. 

Thank you


1 Reply

PR Piramanayagam Ramakrishnan Syncfusion Team June 2, 2016 02:43 PM UTC

Hi Maverick, 
 
Thanks for contacting Syncfusion support. 
 
Query1: Would it be possible to insert icons according to the level? 
We have analyzed your query.  We suspect that you need to show the different images for different levels of Tree nodes. For this requirement you can add the same class name (ex: mailicon) for all level Tree nodes. And we can define the images for different levels by using CSS selector. Please refer the below code sample, 
 
[Style] 
 
#tree1 li .mailicon { /*first level image*/ 
    background-position: -25px -255px; 
} 
 
#tree1 li li .mailicon { /*second level image*/ 
    background-position: -26px -429px; 
} 
 
 
Query2: when drag the node the parentId does not set in the getTreeData(), how do I add the parentId in the node? 
We are unable to reproduce the issue (“when drag the node the parentId does not set in the getTreeData”) at our end. When we drag a node, then we can get the data source with parentId by using getTreeData method.   
 
Please provide about version of “ej.web.all.min.js” file which you are used in your sample. And also provide any simple sample or sample code to reproduce issue at our end. This would be more helpful for us to provide a better solution at the earliest. 
 
Query3: I am trying to use the contextmenu but can't figure out what "rename" method is. 
We have analyzed your query.  We suspect that, you have tried to rename the tree node via context menu. We can achieve this requirement in TreeView control by using “allowEditing” property. This property is used to enable or disable the editing support for TreeView control. If we set as “true” then we can able to edit the Tree node when double click on the tree node.   
 
If you want more details about “allowEditing” property, please refer the help document:http://help.syncfusion.com/js/api/ejtreeview#members:allowediting 
 
For your reference, we have prepared a sample based on your above requirement in the link: http://jsplayground.syncfusion.com/plvkchjl 
 
If still you face any difficulties or if we have misunderstood your requirement, kindly get back to us with more information about the issue or please revert the provided sample based on your application along with the replication procedure to reproduce the issue at our end. This would be more helpful for us to provide a better solution at the earliest. 
 
Regards, 
Piramanayagam R 


Loader.
Up arrow icon