[CLOSED] TreePanel Expandable

  1. #1

    [CLOSED] TreePanel Expandable

    Hi Team Ext.Net Could you please help me with this thread?

    http://forums.ext.net/showthread.php...event-collapse

    Thank you
    Last edited by Baidaly; Dec 13, 2012 at 6:28 AM. Reason: [CLOSED]
  2. #2
    Hello, @osef!

    Sorry, but it's not good to post just link to another question. For example, it can be difficult to find what did you want if the linked question will be deleted. Rules about posting new questions you can read on this thread: http://forums.ext.net/showthread.php?3440

    According to your problem, look at the following sample. The main idea is to override CSS rules to hide expande/collapse tool and to prevent collapsing by listening BeforeItemCollapse event:

    <style>
    	.x-tree-arrows .x-tree-elbow-plus, .x-tree-arrows .x-tree-elbow-minus, .x-tree-arrows .x-tree-elbow-end-plus, .x-tree-arrows .x-tree-elbow-end-minus,
    	.x-tree-lines .x-grid-tree-node-expanded .x-tree-elbow-end-plus, .x-tree-lines .x-tree-elbow-end-plus {
    		background: none;
    	}
    	
    </style>
    @{
    	var treeView = new Ext.Net.TreePanel();
    
    	treeView.Region = Region.Center;
    	treeView.Title = "sample";
    	treeView.Listeners.BeforeItemCollapse.Handler = "return false";
    	var root = new Ext.Net.Node()
    	{
    		Text = "Menu",
    		NodeID = "node0",
    		Expanded = true,
    		Expandable = false
    	};
    
    	var subItem1 = new Ext.Net.Node()
    	{
    		Text = "SubItem 1",
    		NodeID = "node1",
    		Expanded = true,
    		Expandable = false
    	};
    	
     
    	var subItem2 = new Ext.Net.Node()
    	{
    		Text = "SubItem 2",
    		NodeID = "node2",
    		Leaf = true
    	};
     
    	subItem1.Children.Add(subItem2);
    	root.Children.Add(subItem1);
    
    	treeView.Root.Add(root);
    }
    
    @(Html.X().Viewport()
    	.Layout(LayoutType.Border)
    	.Items(i => i
    		.Add(treeView)
    	)
    )
  3. #3
    Hi everybody,

    I think there is a bug in the ExtJS docs.
    http://docs.sencha.com/ext-js/4-1/#!...cfg-expandable

    I see in the sources that it is true by default, not false.

    It is the reason why Expandable="false" is not rendered to a client and, therefore, doesn't work.

    I corrected it in SVN. Now the Expandable="false" works as expected.
  4. #4
    Hi Baidaly, I'm sorry for this action, I don't return to do again and your code It's working thank you for your support.
  5. #5
    No problem ;)

Similar Threads

  1. Replies: 2
    Last Post: Dec 13, 2012, 4:43 AM
  2. [CLOSED] Show no expandable panel in accordion layout panel
    By Tactem in forum 2.x Legacy Premium Help
    Replies: 6
    Last Post: Nov 13, 2012, 4:07 PM
  3. Replies: 5
    Last Post: Mar 23, 2011, 9:57 AM
  4. 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