[CLOSED] Treepanel Grid

  1. #1

    [CLOSED] Treepanel Grid

    Hej Guys.

    I have a weird problem.

    I am trying to make a Treepanel grid as shown in this exsample https://examples2.ext.net/#/TreePane...nced/TreeGrid/

    When i follow the instruction on how initialize the Treegrid

    Everthing goes well

    But when it renders, it renders the tree on very column, meaning that my tree is rendered in very column with there respectiv data bound to that column.

    for a more clear view on it, have a look at the picture i have uploaded.

    My Tree grid does not use a tree store, only nodes initialized on creation

    My code for the treegrid is as following..

    
                LiaTree layoutSettings = new LiaTree("Settings", Ext.Net.Icon.Wrench, this);
                layoutSettings.Fields.Add(new ModelField("Name", ModelFieldType.String));
                layoutSettings.Fields.Add(new ModelField("Age", ModelFieldType.Int));
                layoutSettings.Fields.Add(new ModelField("Sex", ModelFieldType.String));
    
                TreeColumn colName = new TreeColumn(){DataIndex = "Name", Text="Name", Sortable = false, Hidden = false, Flex = 1};
                TreeColumn colAge = new TreeColumn(){DataIndex = "Age", Text="Age", Sortable = false, Hidden = false, Flex = 1};
                TreeColumn colSex = new TreeColumn(){DataIndex = "Sex", Text="Gender", Sortable = false, Hidden = false, Flex = 1};
    
                layoutSettings.ColumnModel.Columns.Add(colName);
                layoutSettings.ColumnModel.Columns.Add(colAge);
                layoutSettings.ColumnModel.Columns.Add(colSex);
    
                Node node = new Node();
                node.Icon = Icon.User;
                node.CustomAttributes.Add(new ConfigItem("Name", "Peter", ParameterMode.Value));
                node.CustomAttributes.Add(new ConfigItem("Age", "30", ParameterMode.Value));
                node.CustomAttributes.Add(new ConfigItem("Sex", "Male", ParameterMode.Value));
    
                layoutSettings.RootNode.Children.Add(node);
                AddToLayout(this, layoutSettings);
    LiaTree inherit from TreePanel as shown here...

    
            public class LiaTree : TreePanel
    
            public Ext.Net.Node RootNode { get; set; }
            public LiaTree(String Title, Icon icon, ILiaBase LiaBase)
            {
                _liaBase = LiaBase;
                this.Title = _liaBase.Translate.GetText("Tree", Title, Title);
                this.Icon = icon;
                this.RootVisible = false;
                this.BodyBorder = 0;
                this.SimpleSelect = false;
                this.MultiSelect = false;
                this.Animate = false;
                this.AnchorWidth = 200;
                
                //tree.Tools.Add(new Tool(ToolType.Refresh,
                //                        Ext.Net.X.Msg.Alert("Message", "Refresh Tool Clicked!").ToScript(), ""));
                this.AutoScroll = true;
    
                this.Listeners.CellDblClick.Handler = "LIA.addCenterTab (record);";
    
                RootNode = new Ext.Net.Node();
                RootNode.NodeID = "root";
                RootNode.Expanded = true;
                this.Root.Add(RootNode);
            }
    So my question is, how can i make it so that the columns only show the text value and not the icon and value of the node..
    Attached Thumbnails Click image for larger version. 

Name:	TreeGridProblem.png 
Views:	166 
Size:	2.8 KB 
ID:	5069  
    Last edited by Daniil; Nov 12, 2012 at 1:08 PM. Reason: [CLOSED]
  2. #2
    You can just have one TreeColumn, as shown bellow:

    TreeColumn colName = new TreeColumn() { DataIndex = "Name", Text = "Name", Sortable = false, Hidden = false, Flex = 1 };
    Column colAge = new Column() { DataIndex = "Age", Text = "Age", Sortable = false, Hidden = false, Flex = 1 };
    Column colSex = new Column() { DataIndex = "Sex", Text = "Gender", Sortable = false, Hidden = false, Flex = 1 };
    Last edited by RCN; Nov 12, 2012 at 12:45 PM.
  3. #3
    Quote Originally Posted by RCN View Post
    You can just have one TreeColumn, as shown bellow:

    TreeColumn colName = new TreeColumn() { DataIndex = "Name", Text = "Name", Sortable = false, Hidden = false, Flex = 1 };
    Column colAge = new Column() { DataIndex = "Age", Text = "Age", Sortable = false, Hidden = false, Flex = 1 };
    Column colSex = new Column() { DataIndex = "Sex", Text = "Gender", Sortable = false, Hidden = false, Flex = 1 };
    Thanks that did it.

    must have been blind to have overlooked that i needed only to use 1 Treecolumn and rest should be normal columns :-)

    Thanks for the responds helped me alot..

    Consider this closed

    Best Regards

    Akpenob
  4. #4
    You're welcome

    Daniil, mark it as closed

Similar Threads

  1. reload store (grid) from treepanel
    By simbal in forum 1.x Help
    Replies: 1
    Last Post: Apr 28, 2012, 9:57 AM
  2. [CLOSED] Drag and drop from treepanel to treepanel in "copy" mode
    By mattwoberts in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Jul 14, 2011, 6:45 PM
  3. Replies: 5
    Last Post: Mar 23, 2011, 9:57 AM
  4. TopBar Size Problem in TreePanel, panle and grid panel
    By Ganesh3.shirsath in forum 1.x Help
    Replies: 0
    Last Post: Nov 18, 2010, 11:38 AM
  5. Dynamically changing Treepanel other Treepanel
    By airforcz in forum 1.x Help
    Replies: 0
    Last Post: Jun 16, 2010, 8:33 AM

Tags for this Thread

Posting Permissions