Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6839721
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T23:45:11+00:00 2026-05-26T23:45:11+00:00

Is it possible to change the items in a card Layout? I want to

  • 0

Is it possible to change the items in a card Layout? I want to use this layout like that of paging a document. From the code below, it does display page 1, 2 and 3. What I tried to test was when I click “Option”, change the items in the card layout.

        var cards = [{
            id: 'card-0',
            html: 'Page 1',
            border: false
        }, {
            id: 'card-1',
            html: 'Page 2',
            border: false
        }, {
            id: 'card-2',
            html: 'Page 3',
            border: false
        }];

        var document = Ext.create('Ext.form.Panel', {
            id: 'testcard',
            padding: '0 0 5 5',
            title: 'test',
            layout: 'card',
            region: 'center',
            activeItem: 0, // index or id
            tbar: [{
                id: 'test',
                text: 'Options',
                handler: function (btn) {
                    cards = [{
                        id: 'card-1',
                        html: 'Page AAAAAAAAAAAA',
                        border: false
                    }, {
                        id: 'card-2',
                        html: 'Page BBBBBBBBBBBB',
                        border: false
                    }];

                    Ext.getCmp('testcard').doLayout();
                }
            }],
            bbar: ['->', {
                id: 'move-prev',
                text: '« Previous',
                handler: function (btn) {
                    navigate(btn.up("panel"), "prev");
                },
                disabled: true
            }, {
                id: 'move-next',
                text: 'Next »',
                handler: function (btn) {
                    navigate(btn.up("panel"), "next");
                }
            }],
            items: cards
        });

Are there any other approaches? Grid with 1 cell displaying html?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T23:45:12+00:00Added an answer on May 26, 2026 at 11:45 pm

    It’s kind of a wrong aproach, first of all the way you written it , the form panel renders with the 3 cards you defined at the begining, on the option handler, the attribution of new objects to the card variable has nothing to do with the form panel, to change or add new elements use the panel’s add method and then the layout setActive.

    function (btn){
        btn.up('panel').add([{
                            id: 'card-1',
                            html: 'Page AAAAAAAAAAAA',
                            border: false
                        }, {
                            id: 'card-2',
                            html: 'Page BBBBBBBBBBBB',
                            border: false
                        }]);
        btn.up('panel').getLayout().setActiveItem(aPage);
    }
    

    I mean this is the purose of the card layout, have a number of components in a panel and switching them and show only one.

    As for the grid with one cell aproach, it depends what you wish to accomplish, if your pages are similar and differ only by the data you can use that. Just create an Ext.XTemplate containing the html you want to render and use the renderer function for the grid column.

    ....
    xtype: 'gridpanel',
    tpl: new Ext.XTemplate('<html goes here/>').compile(),
    columns: [
    {
       dataIndex: 'id',
       header: 'theColumn',
       renderer: function(value,meta,record){
            return this.tpl.applyTemplate(record.data);
        }
    },
    ....
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Does anybody know if it is possible to change the order that the items
Is is possible to change background color of the items in Windows Explorer like
Possible Duplicate: change layout and template in zend dynamically according to the device(android tab,iphone,ipad)
Is it possible to change the color of View Results text in below ?
Is it possible to change C#'s built-in Vector3 struct to not use floating point
Is it possible to change SQL in a z/OS mainframe COBOL application so that
Is it possible to change Tortoise SVN's context menu so that some of the
Is it possible to reduce or change the font of the items of the
Is it possible to change some specific items in a QuerySet object? In my
Everything works fine. My code as below copied from Google's guide. My problem is,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.