关于kendo-angular-resize-sensor的文档

时间:2017-02-08 13:59:53

标签: angular kendo-ui-angular2

我们有很多情况需要在调整容器大小时更改kendo网格高度。 我在npm包上看过:@ progress / kendo-angular-resize-sensor 但我真的没有看到任何文件发表。

将来会有空吗? 如果是的话?

非常感谢。

1 个答案:

答案 0 :(得分:0)

首要任务是让网格“默认”响应。这包括列的自动调整大小和最小宽度设置。

目前,您可以使用following snippet作为这些功能的手动替代方案。

@Component({
  template: `
    <kendo-grid
        [height]="gridHeight">
        ...
    </kendo-grid>
    <!-- An internal component that will soon go public -->
    <kendo-resize-sensor (resize)="resize()"></kendo-resize-sensor>
  `
})
export class AppComponent {
    public gridHeight: number = 300;

    public resize(): void {
      // The Grid height is actually applied to the content area, not as total
      // This is **a bug** that will be fixed soon.
      this.gridHeight = this.elementRef.nativeElement.offsetHeight - 100;
    }

    ...
}

我们希望将调整大小传感器作为实现细节。它仍然可以在客户端应用程序中使用。我们将在未来几周内为其添加文档。