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

ServerSide Node Expand not working

4 Answers 151 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Satish
Top achievements
Rank 1
Satish asked on 20 Feb 2015, 02:56 AM
Hi,

I have the following scenario.

Creating Treeview Control in .aspx file as follows:

                            <telerik:RadTreeView ID="WinFabExplorerMenu" runat="server" OnNodeExpand="WinFabExplorerMenu_NodeExpand" OnClientNodeClicked="ClientNodeClicked">
                            </telerik:RadTreeView>

On client side, adding node to the tree and set expand mode to server side call back. After this, when I clicked the + sign on the node, the server side node expand event not firing.

function OnFederationTileClicked(sender, args) {
    $('#collapseOne').collapse('hide');
    var tree = $find("ctl00_MainContent_WinFabExplorerMenu");
    tree.trackChanges();
    tree.get_nodes().clear();
    var node = new Telerik.Web.UI.RadTreeNode();
    node.set_text(sender.get_navigateUrl());
    node.set_category('Root');
    node.set_expanded(false);
    var attributes = node.get_attributes();
    attributes.setAttribute("Federation", sender.get_navigateUrl());
    attributes.setAttribute("Path", "Test");
    node.set_expandMode(Telerik.Web.UI.TreeNodeExpandMode.ServerSideCallBack);
    node.set_postBack(true);
    tree.get_nodes().add(node);
    tree.commitChanges();
}

4 Answers, 1 is accepted

Sort by
0
Satish
Top achievements
Rank 1
answered on 20 Feb 2015, 03:55 PM
Can someone reply to this?

Thanks
Satish

 

0
Nencho
Telerik team
answered on 24 Feb 2015, 01:43 PM
Hello Satish,

I have investigated the described issue further and it seems like a bug. In order to overcome this behavior, you could add one Node statically in the markup and set its Visible property to false. Please consider the below implementation :
<telerik:RadTreeView ID="WinFabExplorerMenu" runat="server" OnNodeExpand="WinFabExplorerMenu_NodeExpand">
           <Nodes>
               <telerik:RadTreeNode ExpandMode="ServerSideCallBack" Visible="false"></telerik:RadTreeNode>
           </Nodes>
       </telerik:RadTreeView>

In addition, I have already forwarded this issue to our developer team.

Regards,
Nencho
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Skb Dev
Top achievements
Rank 1
answered on 26 Mar 2015, 11:01 AM
The solution posted does not work. Will this issue be fixed?

Until it is fixed the only alternative appears to be to use OnNodeClick instead.
0
Skb Dev
Top achievements
Rank 1
answered on 26 Mar 2015, 11:02 AM
The solution posted doesn't work for me.

Until the bug is fixed the only option appears to be using OnNodeClick rather than OnClientNodeClicked.
Tags
TreeView
Asked by
Satish
Top achievements
Rank 1
Answers by
Satish
Top achievements
Rank 1
Nencho
Telerik team
Skb Dev
Top achievements
Rank 1
Share this question
or