This is a migrated thread and some comments may be shown as answers.
TreeView node does not selectable after changing the text.
2 Answers 6 Views
This is a migrated thread and some comments may be shown as answers.
Daochuen
Top achievements
Rank 1
Daochuen asked on 14 Mar 2019, 04:35 AM

Hello,

After I changed  node's display text in client side the node become not selectable.  for example I have treeview as below: 

$("#treeview").kendoTreeView({
  dataSource: [
    { text: "foo", id:"1", items: [
      { text: "AAA",id:"2" } ] }
  ]
});

I changed "AAA" to "BBB"  by button click (see below code). after that I cannot select that node anymore. the node with 'BBB' function as a LABEL. Does anyone has idea how to resolve it?

 

  $("#btn").click(function(){
     var treeview = $("#treeview").data("kendoTreeView");               
      var myDataItem=treeview.dataSource.get(2); 
      var node = treeview.findByUid(myDataItem.uid);
      node.text("BBB");
      treeview.select(node);
     
 });

2 Answers, 1 is accepted

Sort by
0
Accepted
Eyup
Telerik team
answered on 14 Mar 2019, 09:26 AM
Hi Daochuen,

You are very close. All you need to change is to use the built-in text method provided by the treeview:
https://docs.telerik.com/kendo-ui/api/javascript/ui/treeview/methods/text

In this case it will be:
$("#btn").click(function(){
  ...
  treeview.text(node, "BBB");
});

Here is the full dojo sample:
https://dojo.telerik.com/izuFObIk/4

I hope this will prove helpful.

Regards,
Eyup
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Daochuen
Top achievements
Rank 1
answered on 14 Mar 2019, 07:07 PM
Thanks, that worked great!
Asked by
Daochuen
Top achievements
Rank 1
Answers by
Eyup
Telerik team
Daochuen
Top achievements
Rank 1
Share this question
or