Angular 如何在syncfusion网格组件中隐藏网格微调器
我在项目中使用syncfusion angular GridComponent。我希望网格在创建后有一个微调器,该微调器应该一直旋转直到加载数据。 为了启动微调器,我在创建网格时编写了一个函数: document-table.component.htmlAngular 如何在syncfusion网格组件中隐藏网格微调器,angular,syncfusion,Angular,Syncfusion,我在项目中使用syncfusion angular GridComponent。我希望网格在创建后有一个微调器,该微调器应该一直旋转直到加载数据。 为了启动微调器,我在创建网格时编写了一个函数: document-table.component.html <ejs-grid #grid (created)="creadted()" ...> ... </ejs-grid> 加载数据后,如何停止微调器?例如: 默认情况下,“栅格”显示其所有操作的微调器 因此,如果您需要为
<ejs-grid #grid (created)="creadted()" ...>
...
</ejs-grid>
加载数据后,如何停止微调器?例如:
默认情况下,“栅格”显示其所有操作的微调器
因此,如果您需要为您的操作手动设置微调器,我不是舒尔
如果必须手动设置微调器,如果要根据对网格所做的某些更改触发函数,则可能必须使用setTimeout()
来包装函数调用
@ViewChild('grid')网格:GridComponent
ngOnChanges(更改:SimpleChanges){
this.tableData=changes.data.currentValue;
if(changes.data.currentValue!=null){
setTimeout(()=>this.grid.hideSpinner(),0)
}
}
创建(){
setTimeout(()=>this.grid.showSpinner(),0)
}
另请参见:使用
this.grid.showSpinner()
显示微调器,使用this.grid.hideSpinner()
隐藏微调器。我尝试过,但不起作用。如何加载数据?ngOnChanges
是否被触发?实际上,ejs grid
默认情况下为其所有操作显示微调器。您确定需要手动显示/隐藏它吗?网格的父组件从服务获取数据,并将其作为输入发送到网格组件(DocumentTableComponent),在ngOnChange()中,我检查数据是否已更改,以便将其分配给另一个变量。默认情况下,网格在加载数据之前从不显示微调器,因此我必须使用showSpinner和hideSpinnerworks
@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
}