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

Select event not firing on second click of treeview node

1 Answer 182 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Connections Academy Developer
Top achievements
Rank 1
Connections Academy Developer asked on 22 Nov 2013, 03:06 PM
Hi,

I am developing a webmail client with angularjs and kendoui, it has two panes left for viewing user folders and right for message display / composition.  For displaying the folders I am using kendoui treeview and when they select a node we display the proper messages for that folder.

Problem: When a user choose a folder, Drafts, then clicks on a message to finish composing that message they are unable to click on the Drafts folder node to navigate back to the Drafts folder gridview.

Code:
var theTree = $("#treeview").kendoTreeView({
    dataSource: folderArray,
    template: $("#foldersTemplate").html(),
    expand: function(e) {
        code for grabbing any sub-folders.
    },
    select : function(e) {
        var treeviewInner = e.sender,
            idFolder = treeviewInner.dataItem(e.node).id;
 
        /* set-up angularjs controller scope */
        window.location.href = "#/folder/" + idFolder;  //navigates to the proper folder gridview when node seleced.
    }
});
The issue I'm seeing is that once a node is selected, whenever you re-click on it, the select code does not fire.

Any thoughts on how to work around this?

1 Answer, 1 is accepted

Sort by
0
Alexander Valchev
Telerik team
answered on 26 Nov 2013, 12:37 PM
Hello,

If I understood correctly the problem is that the select event does not fire when the user clicks on an already selected node. This is the default behaviour and if you want to change it you will have to hook up to the click of the .k-state-selected item and trigger the event manually. Please check the following example:

Regards,
Alexander Valchev
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
TreeView
Asked by
Connections Academy Developer
Top achievements
Rank 1
Answers by
Alexander Valchev
Telerik team
Share this question
or