Results 1 to 6 of 6

Thread: responsive confg question

  1. #1
    Sencha Premium Member
    Join Date
    Feb 2012
    Location
    Hillsborough, NC
    Posts
    429
    Answers
    3

    Default responsive confg question

    Is there any way to convert a form from a horizontal layout to a vertical layout with the responsiveConfig?

    I'm just looking into this and it seems to not be possible. But maybe I'm just missing it?

  2. #2
    Sencha Premium Member
    Join Date
    Feb 2012
    Location
    Hillsborough, NC
    Posts
    429
    Answers
    3

    Default

    Quote Originally Posted by worthlutz View Post
    Is there any way to convert a form from a horizontal layout to a vertical layout with the responsiveConfig?

    I'm just looking into this and it seems to not be possible. But maybe I'm just missing it?
    My solution so far is to create a container with a card layout.

    One card has a vertical layout and the other has a horizontal one.

    I then add a method 'setVertical(boolean)" to switch the activeItem from one card to the other and move all items from one card to the other.

    With this responsiveConfig:
    Code:
    responsiveConfig: {
        wide: {
             vertical: false
        }
        tall: {
             vertical: true
        }
    }
    it works.

    It does break Architect Design view with the "Framework Error: Config "vertical"has no setter..."

  3. #3
    Sencha Premium Member
    Join Date
    Feb 2012
    Location
    Hillsborough, NC
    Posts
    429
    Answers
    3

    Default

    It worked partially! When I change size of the browser or rotate my tablet it works. Where it does not work is on startup. It appears that my container component is calling setVertical before any items are added. Therefore no change can be done on initialization.

    This makes whatever is set as default what shows up first. Even if it is wrong.

    Anyone have a suggestion?

  4. #4
    Sencha Premium User mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    40,448
    Answers
    3997

    Default

    If you look at the source of HBox and VBox, all it is is an extension of Ext.layout.container.Box and sets vertical to true/false:

    Code:
    Ext.define('Ext.layout.container.VBox', {
        extend: 'Ext.layout.container.Box',
    
        alias: 'layout.vbox',
    
        alternateClassName: 'Ext.layout.VBoxLayout',
    
        type: 'vbox',
    
        vertical: true
    });
    Ext JS doesn't support changing the layout type on the fly but you can use Ext.layout.container.Box and then change the vertical config on the fly:

    Mitchell Simoens @LikelyMitch

    Check out my GitHub:
    https://github.com/mitchellsimoens

    Posts are my own, not any current, past or future employer's.

  5. #5
    Sencha Premium Member
    Join Date
    Feb 2012
    Location
    Hillsborough, NC
    Posts
    429
    Answers
    3

    Default

    Thanks, Mitchell.

    That looks simpler than my solution of two identical containers, one with horizontal layout and the other with vertical. I was moving the "items" to the "active" card to achieve the desired result. I'll give your suggestion a try.

  6. #6
    Sencha User bressi's Avatar
    Join Date
    Jan 2016
    Posts
    20

    Default

    Hi,

    But using SA 3.5.1 I am not able to add a 'box' layout into configuration panel.

    How to resolve if I would use vertical setter with responseConfig option ?


    Regards,
    Claudia

    Quote Originally Posted by mitchellsimoens View Post
    If you look at the source of HBox and VBox, all it is is an extension of Ext.layout.container.Box and sets vertical to true/false:

    Code:
    Ext.define('Ext.layout.container.VBox', {
        extend: 'Ext.layout.container.Box',
    
        alias: 'layout.vbox',
    
        alternateClassName: 'Ext.layout.VBoxLayout',
    
        type: 'vbox',
    
        vertical: true
    });
    Ext JS doesn't support changing the layout type on the fly but you can use Ext.layout.container.Box and then change the vertical config on the fly:

    Regards,
    Claudia

Posting Permissions

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