Wijmo柔格列宽度角2



我想要Wijmo FlexGrid列宽度应该覆盖全宽。

当我动态分配列,所以不能使用[width]="'*'"

为网格分配模板引用变量。例:flex1

<wj-flex-grid #flex1 
      [itemsSource]="data">
<wj-flex-grid>

然后在ngAfterViewInit回调中设置您的列并为所讨论的列分配'*'宽度,例如

import { Component, ViewChild, AfterViewInit } from '@angular/core';
import { Collection } from 'wijmo/wijmo';
import { FlexGrid } from 'wijmo/wijmo.grid';
@Component({ ... })
export class MyComponent implements AfterViewInit {
  @ViewChild('flex1') protected grid: FlexGrid;
  protected data: any;
  constructor() {
    this.data = new Collection([
      { id: 1, country: 'United States' },
      { id: 2, country: 'Germany' },
    ]);
  }
  public ngAfterViewInit() {
     // Missing part: Set up columns programmatically
     // OP has done this already.
     // Set the column width of the column with binding to the `country` property
     this.grid.columns.getColumn('country').width = '*';
  }
}

相关内容

  • 没有找到相关文章

最新更新