我们在使用afterSelection
功能时遇到问题,过滤器未经检查:
代码是这样的:
<link rel="stylesheet" type="text/css" href="./handsontable.full.min.css">
<script src="./handsontable.full.min.js"></script>
<div id='handsontable' style="width: 100%; height: 100%;">
</div>
<script>
let container = document.getElementById('handsontable');
let hot = new Handsontable(container, {
colHeaders: true,
data: [
['', 'Ford', 'Volvo', 'Toyota', 'Honda'],
['2016', 10, 11, 12, 13],
['2017', 20, 11, 14, 13],
['2018', 30, 15, 12, 13]
],
filters: true,
dropdownMenu: {
items: {
'filter_by_condition': {},
'filter_by_value': {},
'filter_action_bar': {}
}
},
beforeFilter: function () {
},
afterFilter: function (obj) {
console.log('afterFilter', JSON.stringify(obj));
},
afterSelection: function (obj) {
hot.setDataAtCell(0, 0, 'new');
}
});
</script>
重现的步骤:
点击过滤器按钮,取消选中checkbok
结果显示为预期,但点击过滤器按钮,所有复选框都未选中,如下所示:
您能否提出解决此问题的建议?