[CLOSED] How to get parent node of ColumnTree selected node from code-behind

  1. #1

    [CLOSED] How to get parent node of ColumnTree selected node from code-behind

    Hi, I want to take parent node of ColumnTree selected from code-behind. In below code, I can take selected node but I can't take parent node of selected node.

    DefaultSelectionModel dm = TreePanelObjectTemplate.SelectionModel.Primary as DefaultSelectionModel;
    dm.SelectedNode.
    Can you please help me about this situation. Thanks.
    Last edited by Daniil; Nov 26, 2010 at 5:54 AM. Reason: Please use [CODE] tags, [CLOSED]
  2. #2
    Hi,

    You are a premium member, so please post technical support questions on the Premium forum. We're always focused on the Premium forum and can miss your question in another forum.

    I see it's your first post. When you have a chance please read
    http://forums.ext.net/showthread.php...ing-New-Topics

    Regarding the question

    I would suggest you to pass parent node's id to server as extra parameter.

    Example Code behind
    protected void Button_Click(object sender, DirectEventArgs e)
    {
        var parentNodeId = e.ExtraParams["parentNodeId"];
        ColumnTree1.CallNode("setText", parentNodeId, "Hello from Server!");
    }

    Example Markup
    <ext:Button runat="server" Text="Click me" >
        <DirectEvents>
            <Click 
                OnEvent="Button_Click" 
                Before="extraParams.parentNodeId = ColumnTree1.getSelectionModel().getSelectedNode().parentNode.id;"/>
        </DirectEvents>
    </ext:Button>

Similar Threads

  1. Replies: 2
    Last Post: Oct 10, 2011, 1:29 AM
  2. Replies: 2
    Last Post: Sep 22, 2011, 6:37 AM
  3. Replies: 16
    Last Post: Jul 19, 2011, 3:53 AM
  4. Replies: 1
    Last Post: Nov 17, 2010, 12:42 PM
  5. [CLOSED] Get selected node from a TreeGrid or TreePanel from code behind
    By jmcantrell in forum 1.x Legacy Premium Help
    Replies: 12
    Last Post: Jun 23, 2010, 9:19 AM

Posting Permissions