我需要根据复选框状态的更改禁用某些单元格。 我向复选框列添加了一个监听器:
listeners: {
checkchange: function( me , rowIndex , checked , record , e , eOpts) {
var row = me.getView().getRow(rowIndex);
var columnIndex = Ext.getCmp('MyColumnIdToDisable').fullColumnIndex;
Ext.get(row.childNodes[columnIndex]).setDisabled=!checked;
}
}
但是我收到了这个错误:
Uncaught TypeError: Ext.get(...).setDisabled is not a function
最佳答案
您可以使用this.disabledCls
我已经有一个示例,它的功能可能与您需要的相同。它禁用特定的单元格。
https://fiddle.sencha.com/#view/editor&fiddle/1lvm
onCheckcolumnCheckChange: function (checkcolumn, rowIndex, checked, record, eOpts) {
// we need to get a grids view
var view = Ext.first('#MySpecialGridId').getView();
var cell = view.getCell(rowIndex,1);
if (checked) {
// add disabled cls -> disabled
cell.addCls(this.disabledCls);
}else{
// remove the disabled cls -> enabled
cell.removeCls(this.disabledCls)
}
}
关于javascript - 如何根据复选框状态 extJs 6 禁用网格上的单元格,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41943689/