Results 1 to 2 of 2

Thread: Ext.tree.Panel automatic height

  1. #1
    Sencha User
    Join Date
    Jun 2007
    Posts
    7

    Default Ext.tree.Panel automatic height

    How do I create Ext.tree.Panel that automatically resizes to fit its content when nodes are expanded/collapsed?

  2. #2
    Sencha Premium Member skirtle's Avatar
    Join Date
    Oct 2010
    Location
    UK
    Posts
    3,791
    Answers
    585

    Default

    This is very rarely a good idea in practice.

    Here's something that works in simple cases. It won't cope with a header row and if your tree is in a container it almost certainly won't like it. I think getting it to work in the general case would be very tricky.

    Code:
    Ext.create('Ext.tree.Panel', {
        ...
        listeners: {
            afterrender: function() {
                this.getEl().setStyle('height', 'auto');
                this.body.setStyle('height', 'auto');
                this.getView().getEl().setStyle('height', 'auto');
            }
        }
    });

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •