[CLOSED] TreePanel Refresh server side

  1. #1

    [CLOSED] TreePanel Refresh server side

    I'm building a page to filter a treepanel server side.

    Clicking on a button server side, I populate the tree with the following code:

    //remove old nodes
                var q = from myrow in dt.AsEnumerable()
                        where !myrow.Field<int?>("ID_INV_REGISTRY_PARENT").HasValue
                                Description = myrow.Field<string>("Description")
                            ,   ID_INV_REGISTRY = myrow.Field<int?>("ID_INV_REGISTRY")
    //load new nodes in the tree
                foreach (var r in q)
                    Ext.Net.Node root = new Ext.Net.Node()
                        Text = r.Description
                    root.CustomAttributes.Add(new ConfigItem("ID_INV_REGISTRY", Convert.ToString(r.ID_INV_REGISTRY)));
                    root.Children.AddRange(GetFunctionalChildNodes(dt, r.ID_INV_REGISTRY.Value));
                    root.Expandable = root.Expanded = (root.Children.Count > 0);
    //render the content of the tree
    The treepanel is inside an accordion panel.

    After I run this code, the treepanel stay clear without nodes, if I collapse and expand the treepanel inside the accordion panel, then I can see all the nodes in the tree.

    I used the TreeFunctional.Render() method to render the treepanel after I populate it, but it seems to be not enough, so what method should I use to refresh the tree?

    Thank you for your help.

    Have a good day.
    Last edited by Daniil; Feb 12, 2014 at 1:27 PM. Reason: [CLOSED]
  2. #2
    Hi @John_Writers,

    I cannot reproduce with this sample.

    <%@ Page Language="C#" %>
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    <script runat="server">
        protected void Refresh(object sender, DirectEventArgs e)
            this.TreePanel1.Root.Add(new Node()
                Text = "Root " + DateTime.Now.Second,
                Children =
                    new Node()
                        Text = "Child " + DateTime.Now.Second,
                        Leaf = true
    <!DOCTYPE html>
    <head runat="server">
        <title>Ext.NET v2 Example</title>
        <form runat="server">
            <ext:ResourceManager runat="server" />
            <ext:Button runat="server" Text="Refresh" OnDirectClick="Refresh" />
                    <ext:TreePanel ID="TreePanel1" runat="server">
                            <ext:Node Text="Initial Root">
                                    <ext:Node Text="Initial Child" Leaf="true" />
  3. #3
    is quite the same I did..

    Anyway, I solved calling the Render Method on the parent panel with accordion layout..

    Thank you for your time!

    Have a good day!

Similar Threads

  1. [CLOSED] Refresh gridpanel server side
    By PriceRightHTML5team in forum 2.x Legacy Premium Help
    Replies: 2
    Last Post: Jul 05, 2013, 12:27 PM
  2. [CLOSED] Refresh TreePanel Server Side
    By Antonio09 in forum 2.x Legacy Premium Help
    Replies: 2
    Last Post: Oct 17, 2012, 5:00 PM
  3. How can i refresh the Treepanel in server side
    By NishaLijo in forum 1.x Help
    Replies: 7
    Last Post: Jan 18, 2012, 10:00 PM
  4. Refresh treepanel from server side after event
    By MikeWallaroo in forum 1.x Help
    Replies: 3
    Last Post: Nov 28, 2011, 9:43 AM
  5. Replies: 1
    Last Post: May 13, 2009, 12:14 PM

Posting Permissions