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

Double Click to Edit Node when Template is Used

Hello,


1.     When a TreeView uses templates to display the nodes, it appears that this disables using double click to edit the node text.  Is this correct?

2.     I see that F2 will still invoke an editor for the node text even when a template is used.  Is there a way to programmatically invoke this editor?

Thank You,

Randy Craven







1 Reply

KR Karthik Ravichandran Syncfusion Team April 10, 2017 11:33 AM UTC

Hi Randy, 
 
Thanks for contacting Syncfusion support. 
 
Query 1:  When a TreeView uses templates to display the nodes, it appears that this disables using double click to edit the node text.  Is this correct? 
 
When enable the template API in ejTreeView, we cannot edit the TreeView template data’s. You can achieve your requirement in application level by using TreeView create event. Please refer the below code block. 
 
 
function onTreeviewCreate() { 
    $(this.element).dblclick(function (event) { 
         // write your custom code for double click here 
     }) 
 
    $(this.element).keydown(function (event) { 
        if (event.which == 113) { 
            // write your custom code for F2 here 
        } 
    }) 
} 
 
 
 
You can get the tree view data using getTreeData method also you can able to refresh the tree view with updated data using ‘refresh’ method in tree view. To know more details about ejTreeView, please refer the below documentation link:

UG: https://help.syncfusion.com/js/treeview
 
 
 
Query 2: I see that F2 will still invoke an editor for the node text even when a template is used.  Is there a way to programmatically invoke this editor? 
 
Please track the incident #177001 regarding “Issue in TreeView while F2 key press”.  
 
 
Please let us know if you have any concerns. 
 
Regards, 
Karthik R 


Loader.
Live Chat Icon For mobile
Up arrow icon