0

我有两组按钮(在 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];
                }}
        }
    ]}

我在 Sencha 论坛中找到了一些帮助,但我无法解决问题。

4

1 回答 1

0

这是一句话:

    pressed: true,

要在按钮配置说明中插入。

于 2013-10-02T09:56:51.423 回答