Search code examples
javascriptextjssencha-touch

Switching views in a tabpanel in Sencha Touch from a segmented button


I have an application created with Sencha Touch 2, I need to create a card layout with different views switched with a segmented button, (Following MVC concept) but It is not working..

My view:

config: {
    layout: 'vbox',
    items : [
      {
        xtype: 'header'
      },
      {
        xtype: 'container',
        layout: 'card',
        items: [
          {
            xtype: 'container',
            layout: 'vbox',
            itemId: 'presence',
            items: [
              {
                xtype: 'surveyHeaderBrands'
              },
              {
                xtype: 'surveyEditorMatrix',
                flex : 1
              }
            ]
          },
          {
            xtype: 'container',
            layout: 'vbox',
            itemId: 'auxiliaryFields',
            items: [
              {
                xtype: 'button',
                text: 'button'
              }
            ]
          },
          {
            xtype: 'container',
            layout: 'vbox',
            itemId: 'profiles',
            items: [
              {
                xtype: 'button',
                text: 'button2'
              }
            ]
          },
          {
            xtype: 'container',
            layout: 'vbox',
            itemId: 'photos',
            items: [
              {
                xtype: 'button',
                text: 'button3'
              }
            ]
          }
        ]
      }
    ]
  }

In the controller I don´t know what code should be the correct.. I have tested with this.control etcetera but It is not working... any clue, please!

Thank you


Solution

  • I found the solution, I added 'flex:1' to the main container and now it is working..

    Thank you for your help!