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

Dynamically changing text

I would like to change the text that is displayed based on criteria - aka "loading treeview node n of x" how would I go about that.

1 Reply

PR Piramanayagam Ramakrishnan Syncfusion Team August 1, 2016 11:25 AM UTC

Hi Christopher, 
 
Thanks for contacting Syncfusion support. 
 
We have analyzed your query, and we have provided option to change the text of TreeNode dynamically by using public method “updateText”. You need to pass the Id or object of the node and new text to this method. It will update the text of the given TreeView node. Please refer the below code sample. 
 
[Script] 
 
$("#tree").ejTreeView({ 
    loadOnDemand: true, 
    allowEditing: true, 
    fields: { dataSource: localData, id: "id", parentId: "pid", text: "name", hasChild: "hasChild" }, 
    nodeExpand: function (args) { 
        if (args.value.indexOf("-expanded") == -1) 
            this.updateText(args.currentElement, args.value + "-expanded"); 
    } 
}); 
 
 
For more details about the updateText method then please refer the help document, 
 
For your reference, we have prepared a sample based on your requirement (“Dynamically changing text”) in the link: http://jsplayground.syncfusion.com/rvvtpkvt 
   
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. 
 
Regards, 
Piramanayagam R

Loader.
Live Chat Icon For mobile
Up arrow icon