Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>To make the card transition when you click a button use the setActiveItem method in your handler:</p> <pre><code>var tapHandler = function(button, event) { mainPanel.setActiveItem(1); }; </code></pre> <p>It can also take a reference to the panel component directly (which is useful if you ever change the order of the cards and the indices change).</p> <p>Your toolbar is docked to the outer container, not to the cards, so it won't change when you change cards. You could dock two different toolbars to the card panels instead if you wanted it to change (or alter it programmatically, I suppose).</p> <p>Also you can use the 'spacer' type to spread your buttons apart to each side of the tool. Here is your code adjusted to do what I think you probably want (on phone only, for clarity)</p> <pre><code>Ext.setup({ onReady: function() { /*HANDLERS *********************************************************************************/ var showAlert = function(btn, event) { Ext.Msg.alert('Title', 'Diste ' + event.type + ' en el botón "' + btn.text + '"', Ext.emptyFn); }; var tapHandler = function(button, event) { mainPanel.setActiveItem(blue, {type: 'slide'}); }; var backHandler = function(button, event) { mainPanel.setActiveItem(green, {type: 'slide', direction: 'right'}); }; /*UI *********************************************************************************/ var green = new Ext.Panel({ dockedItems: [{ xtype: 'toolbar', ui: 'light', title: 'My Toolbar', items: [{ text: 'Sobre App', ui: 'round', handler: showAlert }, { xtype:'spacer'}, { text: 'Check-in', ui: 'forward', handler: tapHandler }] }], style: 'background-color:#3b7E3b', html: 'Green' }); var blue = new Ext.Panel({ dockedItems: [{ xtype: 'toolbar', ui: 'light', title: 'Check-in', items: [{ text: 'Back', ui: 'back', handler: backHandler }] }], style: 'background-color:#3b3b7E', html: 'Blue' }); var mainPanel = new Ext.Panel({ layout: 'card', fullscreen : true, items: [green, blue] }); } }); </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload