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

Dynamically changing text

Thread ID:





125217 Jul 31,2016 09:54 PM UTC Aug 1,2016 11:25 AM UTC JavaScript 1
Tags: ejTreeView
Asked On July 31, 2016 09:54 PM UTC

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.

Piramanayagam Ramakrishnan [Syncfusion]
Replied On 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. 
    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. 
Piramanayagam R


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