This is a migrated thread and some comments may be shown as answers.

unselect incomplete

1 Answer 113 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Frederic
Top achievements
Rank 1
Veteran
Iron
Frederic asked on 25 Sep 2020, 02:10 PM

Hi, I follow the documentation about un-selecting an item in a treeview, like this: 

 

ktv.select($());

After, if I call ".select()", there's no node returned.  And, if I search for k-node-selected", there's also none.

BUT

the node with id "(id-of-treeview)_tv_active" is still there.  And, because we used it for some query, we got errors.

When we create a treeview from a div called <div id="test"></div>

The selected node gets its ID set to id="test_tv_active".

First, I don't think you should use an "id" for that.

And, you can fix the "unselect" by also removing the id from that item when we un-select it.

 

1 Answer, 1 is accepted

Sort by
0
Neli
Telerik team
answered on 29 Sep 2020, 10:37 AM

Hi Frederic,

Thank you very much for the feedback. We always appreciate any feedback that could be helpful to improve our widgets.  

The "treeview_tv_active" id is not removed when there is a focused node. Here is a Dojo example where the selection is cleared on a button click. As you will see even if the "bar 2" node is selected and then the selection is cleared, the first parent node will be focused. 

In case you need to remove the _tv_active id, you could do it by using the jQuery removeAttr method as below:

$("#treeview_tv_active").removeAttr("id", "treeview_tv_active")

I hope the above helps. Let me know in case you have additional questions or comments on the matter.

Regards,
Neli
Progress Telerik

Five days of Blazor, Angular, React, and Xamarin experts live-coding on twitch.tv/CodeItLive, special prizes, and more, for FREE?! Register now for DevReach 2.0(20).

Tags
TreeView
Asked by
Frederic
Top achievements
Rank 1
Veteran
Iron
Answers by
Neli
Telerik team
Share this question
or