1. #1
    Sencha User
    Join Date
    Jun 2011
    Posts
    3
    Vote Rating
    0
    caryn is on a distinguished road

      0  

    Default Unanswered: Use a variable buttongroup/togglegroup name - when creating instance using xtype

    Unanswered: Use a variable buttongroup/togglegroup name - when creating instance using xtype


    Hi

    I am trying to create two instances of a ui control - with a button group as follows :
    Ext.define('my.pack.Control', {
    extend: 'Ext.container.Container',
    xtype: 'control-class',
    mygroup:'booyah',
    items: [
    {
    type: 'buttongroup',
    align: 'left',
    alias: 'intervalButtonGroup',
    items: [
    {
    xtype: 'button',
    text: '1h',
    enableToggle: true,
    toggleGroup: mygroup,
    },{
    xtype: 'button',
    text: '6h',
    enableToggle: true,
    toggleGroup: mygroup,
    }]
    }]
    });

    var pcontrol1 = Ext.create('my.pack.Control',{
    mygroup: 'var1,
    });

    var pcontrol2 = Ext.create('my.pack.Control',{
    mygroup: 'var2,
    });

    How can i create the two instances so that the toggle groups are independent ? I want the two controls to be independent so that the two sets of buttons ( four total ) are not all part of the same button group.
    I cannot seem to pass in the group name as shown above ..any ideas ? Basically want to be able to namespace the two togglegroup names.

    Thanks !!

  2. #2
    Sencha User
    Join Date
    Jun 2011
    Posts
    3
    Vote Rating
    0
    caryn is on a distinguished road

      0  

    Default


    Should I be overriding the initComponent to create a dynamic toggle group ?
    initComponent: function() {
    Ext.Array.forEach(this.items.items[0].items.items ,function(mygroup) {
    mygroup.toggleGroup = this.initialConfig.namespace;
    });
    }

Tags for this Thread

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar