How can i refresh the Treepanel in server side

  1. #1

    How can i refresh the Treepanel in server side

    Hi,

    I am binding the tree dynamically with this code.


     if (!X.IsAjaxRequest)
                {
    
                    Ext.Net.TreeNode treeNode = new Ext.Net.TreeNode();
                    treeNode.Text = "Categories";
                    TreePanel2.Root.Add(GetNodes(0, treeNode));
                    treeNode.Expanded = true;
    
    }
     private Ext.Net.TreeNode GetNodes(int Row, Ext.Net.TreeNode treeNode)
            {
                DrmsDBDataContext db = new DrmsDBDataContext();
    
                var lst = from p in db.FoodMenuCategories where p.ParentID == Row select p;
                foreach (FoodMenuCategory fc in lst)
                {
                    Ext.Net.TreeNode treeNode2 = new Ext.Net.TreeNode();
                    treeNode2.NodeID = fc.FDMenuCatID.ToString();
                    treeNode2.Text = fc.FDMenuCatName;
                    treeNode2.Qtip = fc.FDMenuCatName;
                    treeNode2.NodeID = fc.FDMenuCatID.ToString();
                    var lst1 = from p in db.FoodMenuCategories where p.ParentID == fc.FDMenuCatID select p;
                    if (lst1.Count() > 0)
                        GetNodes(fc.FDMenuCatID, treeNode2);
                    treeNode.Nodes.Add(treeNode2);
    
                }
                return treeNode;
    
            }
    First i binded the tree with category name.when we add the new category,i want to refresh the treepanel dynamically.i used this code


    Treepanel.Reload();
    I can't use (https://examples1.ext.net/#/TreePane...h_Static_Tree/) refresh static tree example.First i am calling one direct method for the save function after that only i want to refresh the tree panel.when i call handler,handler will work first,after that only direct method will work.Suggest any idea please.................................Please..... ...........................help................... ..


    Please give me the reply.How i can refresh it ?
    Last edited by NishaLijo; Feb 16, 2011 at 7:56 AM.
  2. #2

    How can i refresh the Treepanel in server side

    Hi,

    Why nobody is not giving the reply to me.Pls help me.I am stuck with this part.


    Quote Originally Posted by NishaLijo View Post
    Hi,

    I am binding the tree dynamically with this code.


     if (!X.IsAjaxRequest)
                {
    
                    Ext.Net.TreeNode treeNode = new Ext.Net.TreeNode();
                    treeNode.Text = "Categories";
                    TreePanel2.Root.Add(GetNodes(0, treeNode));
                    treeNode.Expanded = true;
    
    }
     private Ext.Net.TreeNode GetNodes(int Row, Ext.Net.TreeNode treeNode)
            {
                DrmsDBDataContext db = new DrmsDBDataContext();
    
                var lst = from p in db.FoodMenuCategories where p.ParentID == Row select p;
                foreach (FoodMenuCategory fc in lst)
                {
                    Ext.Net.TreeNode treeNode2 = new Ext.Net.TreeNode();
                    treeNode2.NodeID = fc.FDMenuCatID.ToString();
                    treeNode2.Text = fc.FDMenuCatName;
                    treeNode2.Qtip = fc.FDMenuCatName;
                    treeNode2.NodeID = fc.FDMenuCatID.ToString();
                    var lst1 = from p in db.FoodMenuCategories where p.ParentID == fc.FDMenuCatID select p;
                    if (lst1.Count() > 0)
                        GetNodes(fc.FDMenuCatID, treeNode2);
                    treeNode.Nodes.Add(treeNode2);
    
                }
                return treeNode;
    
            }
    First i binded the tree with category name.when we add the new category,i want to refresh the treepanel dynamically.i used this code


    Treepanel.Reload();
    I can't use (https://examples1.ext.net/#/TreePane...h_Static_Tree/) refresh static tree example.First i am calling one direct method for the save function after that only i want to refresh the tree panel.when i call handler,handler will work first,after that only direct method will work.Suggest any idea please.................................Please..... ...........................help................... ..


    Please give me the reply.How i can refresh it ?
  3. #3
    U can use listeners in treepanel.

    call a method from listener and it will solve your problem.
  4. #4
    How do you want to refresh your tree (using Reload) if you ignore population of the Tree? (-> !X.IsAjaxRequest)
    Or am I missing anything?
  5. #5

    How can i refresh the Treepanel in server side

    Hi,

    I uploaded one image over here.This window is a pop up window.In the left side i am binding the tree panel according to the right side of the add food menu category window.In this example when i click on the soup folder the right side new food menu category window will come.When we save that data,i want to refresh the tree according to that foodmenu category?U have any solution?Pls give me the anser.






    Quote Originally Posted by nextSTEP View Post
    How do you want to refresh your tree (using Reload) if you ignore population of the Tree? (-> !X.IsAjaxRequest)
    Or am I missing anything?
    Attached Thumbnails Click image for larger version. 

Name:	samplewindow.PNG 
Views:	397 
Size:	45.6 KB 
ID:	2336  
  6. #6
    Hi,

    1. If you use AsyncTreeMode then use 'reload' js method of the node
    2. If you use TreeNode then see https://examples1.ext.net/#/TreePane...h_Static_Tree/
  7. #7

    How can i refresh the Treepanel in server side

    Hi Vladmir,

    I think u didn't get my question.its a pop up window.Left side is treepanel and other right side is windows .when we save that new category in that window,we have to refresh the treepanel according to that category.I have one event only there "Save",.How can i do "AsyncTreeMode then use 'reload' js method of the node" or " https://examples1.ext.net/#/TreePane...h_Static_Tree/" this one there?.Pls give me a reply.




    Quote Originally Posted by Vladimir View Post
    Hi,

    1. If you use AsyncTreeMode then use 'reload' js method of the node
    2. If you use TreeNode then see https://examples1.ext.net/#/TreePane...h_Static_Tree/
  8. #8

    Did you find your solution? please share your solution here

    Did you find your solution? please share your solution here. Thanks

Similar Threads

  1. Refresh treepanel from server side after event
    By MikeWallaroo in forum 1.x Help
    Replies: 3
    Last Post: Nov 28, 2011, 9:43 AM
  2. Replies: 2
    Last Post: Feb 21, 2011, 10:29 AM
  3. [CLOSED] How to close a Ext Window from server side and refresh parent
    By GmServizi in forum 1.x Legacy Premium Help
    Replies: 10
    Last Post: Apr 15, 2010, 7:56 AM
  4. Replies: 1
    Last Post: May 13, 2009, 12:14 PM
  5. TreePanel server side
    By swarnock in forum 1.x Help
    Replies: 7
    Last Post: Jan 30, 2009, 5:27 AM

Posting Permissions