简体   繁体   中英

Extjs 4.1 - CheckboxModel within checkcolumn in grid Fail?

I try to work with checkboxmodel and checkcolumn in . 使用checkboxmodel和checkcolumn。 But i found a bug.
That is when i click checkboxmodel after i click checkcolumn I see no row is selected but when i click my button to get selected, It have ?

Here is my button to get selection

Ext.create('Ext.Button', {
        text: 'Click me',
        visible: false,
        renderTo: Ext.getBody(),
        handler: function() {
            //alert('You clicked the button!');
            var s = grid.getSelectionModel().getSelection();
            Ext.each(s, function (item) {
                alert(item.data.name);
            });
        }
    });


Follow my step you will see a bug
click checkboxmodel and you will see like below 点击checkboxmodel,您将看到如下所示

在此处输入图片说明

click Active column and you will see like below 点击“活动”列,您将看到如下所示 在此处输入图片说明

click button "Click me" and you will see a bug like (no selection here? ). 单击“单击我”按钮,您将看到一个错误(此处没有选择?)。 How to fix this bug. Thanks

在此处输入图片说明

Found it..

Just add "stopSelection : false" in your checkcolumn xtype @trungkien

, {
            xtype: 'checkcolumn',
            text: 'Active',
            dataIndex: 'active',
            stopSelection : false,
            align: 'center',
            defaultType: 'boolean'
        }

I hope this will work.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM