默认选择按钮extjs4.1

时间:2013-10-02 09:41:47

标签: javascript dom button extjs extjs4.1

我有两组按钮(在Extjs 4.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,但我无法解决问题。

1 个答案:

答案 0 :(得分:0)

这就是:

    pressed: true,

要插入按钮配置说明。