gpt4 book ai didi

javascript - 扩展JS 4.2 : Checkbox model selection issue

转载 作者:行者123 更新时间:2023-11-28 09:05:51 25 4
gpt4 key购买 nike

我最近从 4.1.3 切换到 4.2.1。我有一个带有复选框模型的网格。当用户选择或取消选择记录时,应用程序会根据公共(public)记录属性值选择(或取消选择)所有相关记录。这工作得很好,但是,迁移后,停止工作。当我查看 FB 时,我可以看到触发了两个事件(选择和取消选择)

var exSelectionModel = Ext.create('Ext.selection.CheckboxModel', {
checkOnly: false,

viewConfig: {
listeners: {
beforecellmousedown: function(view, cell, cellIdx, record, row, rowIdx, eOpts){

}
}
},
listeners: {

selectionchange: function(sm, selections) {

console.log(selections);
},


select: function( sm, record, index, eOpts ){

var blockId = record.data.blockId;

var blockRecords = sm.getStore().queryBy(function(rec){
return rec.data.blockId == blockId;


var records = new Array();
Ext.each(blockRecords.items, function(bRec){
records.push(bRec);
});

sm.select(records,true,true);


},
deselect: function( sm, record, index, eOpts ){
var blockId = record.data.blockId;


var blockRecords = sm.getStore().queryBy(function(rec){
return rec.data.blockId == blockId;
});

var records = new Array();
Ext.each(blockRecords.items, function(bRec){
records.push(bRec);
});

sm.deselect(records,true,true);
}
}

});

Ext JS 4.2.1 与 4.1.3 相比有什么变化

最佳答案

看来我找到了答案。我添加了以下属性

    checkOnly: true,
allowDeselect: false,
ignoreRightMouseSelection: true,

4.2.1 中发生了一些变化或某个地方出现了问题

关于javascript - 扩展JS 4.2 : Checkbox model selection issue,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17124841/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com