选中全部复选框Boxlabel无法在Internet Explorer中单击

时间:2016-11-27 13:31:31

标签: extjs checkbox combobox

在我下面提到的小提琴中,选择全部复选框在Internet Explorer中无法点击。它在chrome和Firefox中正常工作 https://fiddle.sencha.com/#view/editor&fiddle/1kn2

我正在使用extjs版本6.0.1

1 个答案:

答案 0 :(得分:1)

这是因为你使用了padding: '0, 0, 0, -13',它不允许你点击隐藏的复选框(按IE浏览器)。

您似乎不想显示默认复选框。因此,您可以使用component代替checkbox来实现相同的功能。

{
                xtype: 'component',
    //creating unique id because we need handle of this checkbox later
                id: id + 'selectAllChkBox',
            html: '<img class="checkbox-unchecked" style="height:13px;width:13px;"></img>' + ' Select All',
                    listeners: {
        render: function(chkBox){
            chkBox.getEl().on({
                click: function() {

                    combo.expand();
                    if (!allSelected) {
                        combo.select(combo.getStore().getRange());
                        totalCount = combo.getStore().getRange().length;

                        allSelected = true;
                        chkBox.setHtml('<img class="checkbox-checked " style="height:13px;width:13px;"></img>' + ' Deselect All');

                    } else {
                        combo.reset();
                        combo.setValue(null);
                        totalCount = 0;
                        allSelected = false;
                        chkBox.setHtml('<img class="checkbox-unchecked " style="height:13px;width:13px;"></img>' + ' Select All');
                    }               }
            });
        }
                    }

            }