【问题标题】:Selecting buttons by default extjs4.1默认选择按钮 extjs4.1
【发布时间】:2013-10-02 09:41:46
【问题描述】:

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

【问题讨论】:

    标签: javascript dom button extjs extjs4.1


    【解决方案1】:

    这个词:

        pressed: true,
    

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

    【讨论】:

    • this 是我从中获取的手册。
    猜你喜欢
    • 1970-01-01
    • 2013-03-01
    • 1970-01-01
    • 1970-01-01
    • 2016-12-26
    • 2021-11-12
    • 2013-07-20
    • 1970-01-01
    相关资源
    最近更新 更多