2013-10-02 8 views
0

У меня есть две группы кнопок (в Extjs 4.1), которые можно проверить только по одному. Проблема в том, что я хочу, чтобы один из них был проверен в начале (когда сетка загружается). Код ниже:Выбор кнопок по умолчанию extjs4.1

{ 
    xtype : 'checkboxgroup', 
    store : checked, 
    columns : 3, 
    vertical : false, 
    singleSelect: true, 
    items : [ 
     { 
     xtype: 'button', 
     text: 'name', 
     width: 75, 
     toggleGroup: 'mygroup', 
     enableToggle: true, 
     listeners: { 
       click: function(th) { 
       //this == the button, as we are in the local scope 
        checked = [1,0,0]; 
       }} 
     }, { 
     xtype: 'button', 
     text: 'buyer_member_id', 
     width:100, 
     toggleGroup: 'mygroup', 
     enableToggle: true, 
     listeners: { 
       click: function(th) { 
       //this == the button, as we are in the local scope 
        checked = [0,1,0]; 
       }} 
     }, { 
     xtype: 'button', 
     text: 'id', 
     width: 50, 
     toggleGroup: 'mygroup', 
     enableToggle: true, 
     listeners: { 
        click: function(th) { 
       //this == the button, as we are in the local scope 
        checked = [0,0,1]; 
       }} 
     } 
    ]} 

Я нашел некоторую помощь in the Sencha forum, но я не мог решить эту проблему.

ответ

0

Это слово:

pressed: true, 

Чтобы вставить в инструкции по настройке кнопки.

+0

И [это] (http://docs.sencha.com/extjs/4.2.2/#!/api/Ext.button.Button) - это руководство, в котором я его взял. – softwareplay

Смежные вопросы