angular - 如何在syncfusion Grid组件中隐藏网格微调器
问题描述
我在我的项目中使用了 syncfusion angular GridComponent。我希望网格在创建后有一个微调器,并且微调器应该旋转直到加载数据。为了启动微调器,我为创建网格时编写了一个函数:
文档-table.component.html
<ejs-grid #grid (created)="creadted()" ...>
...
</ejs-grid>
文档表.component.ts:
@ViewChild('grid') grid: GridComponent
ngOnChanges(changes: SimpleChanges){
this.tableData = changes.data.currentValue;
if(changes.data.currentValue != null){
this.grid.hideSpinner=()=>false; //it doesn't work and the spinner still spinning
}
created(){
this.grid.hideSpinner =()=>true; //spinner start spinning
}
加载数据后如何停止微调器?
解决方案
ejs -gird 文档说:
默认情况下,grid 显示所有动作的微调器。
因此,如果您需要为您的操作手动设置微调器,我不放心。
setTimeout()
如果您必须手动设置微调器,如果您想根据对网格所做的一些更改来触发函数,则可能必须用 a 包装函数调用。
@ViewChild('grid') grid: GridComponent
ngOnChanges(changes: SimpleChanges){
this.tableData = changes.data.currentValue;
if(changes.data.currentValue != null) {
setTimeout(() => this.grid.hideSpinner(), 0)
}
}
created() {
setTimeout(() => this.grid.showSpinner(), 0)
}
推荐阅读
- html - 元素的动态 ID
- sql-server - 如何获取在特定产品名称日期之后没有任何条目的那些hotelid?
- c++ - 在 QT 中编辑 .txt 文件
- ruby - 如何使用范围按部分变量过滤数据
- node.js - 我无法使用 Nodemailer 制作邮件系统
- c - 配置文件错误,fopen指令找不到文件或目录
- oracle - 如何使 Oracle ALTER TABLE MODIFY 脚本具有幂等性?
- python - 如何配置 django 媒体文件夹?
- c# - System.TypeLoadException:无法加载类型 System.Net.HttpStatusCode、netstandard,同时解码自定义属性:(null)
- python - 将整数与无类型进行比较