1. #1
    Sencha User
    Join Date
    Sep 2012
    Posts
    30
    Vote Rating
    0
    chitgoks is on a distinguished road

      0  

    Default Answered: how to do dynamic items: [ ]

    Answered: how to do dynamic items: [ ]


    my view class looks something like this

    Code:
    Ext.define('tmp.view.Myclass, {
    extends: 'Ext.Panel',
    config: {
    items: [
    {
    html: 'part 1',
    },
    {
    html: 'part 2',
    },
    ]
    }
    });
    i would like to do this in a such. so that i do not have to manually put html: 'part #' one by one. is this possible?

  2. Code:
    {
    config:{//....},
    initialize: function() {
            var me = this,i;
            me.callParent();
            for(i=0;i<2;i++){
               me.add({
                  html: 'part '+i
               });
            }
    }
    }

  3. #2
    Sencha User
    Join Date
    Apr 2010
    Location
    China
    Posts
    227
    Vote Rating
    20
    Answers
    64
    haduki will become famous soon enough haduki will become famous soon enough

      0  

    Default


    Code:
    {
    config:{//....},
    initialize: function() {
            var me = this,i;
            me.callParent();
            for(i=0;i<2;i++){
               me.add({
                  html: 'part '+i
               });
            }
    }
    }

  4. #3
    Sencha User
    Join Date
    Sep 2012
    Posts
    30
    Vote Rating
    0
    chitgoks is on a distinguished road

      0  

    Default


    thank you haduki! this worked!

Thread Participants: 1

Tags for this Thread