Feb 12, 2014, 8:13 AM
[CLOSED] TreePanel Refresh server side
Hi,
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:
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.
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
TreeFunctional.Root.Clear();
var q = from myrow in dt.AsEnumerable()
where !myrow.Field<int?>("ID_INV_REGISTRY_PARENT").HasValue
select
new
{
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);
TreeFunctional.Root.Add(root);
}
//render the content of the tree
TreeFunctional.Render();
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]