1金币
pivotGrid中能和flexGrid一样设置漏斗型的筛选麽?用来筛选数据;以下是我写的一部分代码, 筛选出现了,但为啥addEventListener中的事件没生效呢?
const initFilterEditor = () => {
const field = tableData.value.fields.getField("ITEM ID");
if (field) {
filterEditor.value = new PivotFilterEditor("#filterEditor", field);
filterEditor.value.addEventListener(
filterEditor.value.hostElement,
"apply",
onFilterApply,
);
}
};
const onFilterApply = () => {
console.log("Filter applied:", filterEditor.value.filter);
//点apply时执行的事件
filterEditor.value.hostElement.style.display = "none"; // 隐藏过滤器编辑器
tableData.value.refresh(); // 刷新数据
};
|
|