要实现撤销选中的数据,可以使用Ext.selection.CheckboxModeldeselectAll方法。具体做法是在选择模型中添加一个listeners配置项,在selectionchange事件触发时调用deselectAll方法撤销选中的数据。以下是一个示例代码:

selModel: {
    mode: "simple",
    selType: "checkboxmodel",
    listeners: {
        selectionchange: function(selectionModel, selectedRecords) {
            if (selectedRecords.length === 0) {
                selectionModel.deselectAll();
            }
        }
    }
}

在上面的代码中,当选中的记录数为0时(即没有选中任何数据),调用deselectAll方法撤销选中的数据。

希望这个解决方案对您有帮助

selModel mode simple selType checkboxmodel 添加后不能撤銷选中的数据

原文地址: http://www.cveoy.top/t/topic/hX3o 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录