Javascript Handsontable-使用afterSelection时过滤器工作不正常
我们在使用Javascript Handsontable-使用afterSelection时过滤器工作不正常,javascript,jquery,html,css,handsontable,Javascript,Jquery,Html,Css,Handsontable,我们在使用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%
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>
让容器=document.getElementById('handsontable');
let hot=新的可手持设备(容器、{
colHeaders:是的,
数据:[
[“福特”、“沃尔沃”、“丰田”、“本田”],
['2016', 10, 11, 12, 13],
['2017', 20, 11, 14, 13],
['2018', 30, 15, 12, 13]
],
过滤器:是的,
下拉菜单:{
项目:{
'按条件筛选':{},
'按值筛选':{},
'过滤器动作栏':{}
}
},
beforeFilter:函数(){
},
后滤器:功能(obj){
log('afterFilter',JSON.stringify(obj));
},
选择后:功能(obj){
setDataAtCell(0,0,'new');
}
});
复制步骤:
<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>
您能给我们一个建议来解决这个问题吗?可能重复的可能重复的