[英]Angular 4 Kendo grid expand detail template by clicking on the row instead of the arrow
[英]how to automatically expand detail in kendo grid for angular
我在使用角度自动扩展Kendo网格中的细节时遇到问题。 我想在加载数据时扩展详细信息。 我正在使用ng-template kendoGridDetailTemplate。 有没有办法自动扩展细节?
我尝试使用kendoGridCellTemplate仅输入文本,但是无法加载数据。
<kendo-grid [data]="boxList" > <kendo-grid-column field ="BOX_NO" title="box_no"> </kendo-grid-column> <ng-template kendoGridDetailTemplate let-dataItem> <p>{{dataItem.ETC}}</p> </kendo-grid>
我希望它们显示自动扩展。 没有点击按钮。
您可以执行以下操作:
在您的代码中添加一个viewchild以便能够访问网格
@ViewChild(GridComponent) private grid: GridComponent;
在ngOnInit中执行以下操作
for (let i = 0; i < this.boxList.length; i++){ this.grid.expandRow(i); }
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.