0
ホーグリッドセルエディター内にユーザーコントロールを配置しますか?グリッドセル内のユーザーコントロール
列定義:
{
headerName: 'Product',
field: 'product',
width: 140,
editable: true,
cellRendererFramework: ProductEditorComponent
},
とエディタコンポーネント:
@Component({
selector: 'ag-product-editor-control',
template: `
<div #container>
<ng-select
[options]="products"
[multiple]="true"
placeholder="Select multiple">
</ng-select>
</div>
`,
providers: [RegionProductsConfigService]
})
export class ProductEditorComponent implements AgEditorComponent, AfterViewInit {
products: Array<any>;
item: any;
@ViewChild('container', { read: ViewContainerRef }) private container;
ngAfterViewInit() {
this.container.element.nativeElement.focus();
}
agInit(params : any): void {
this.products = RegionProductsConfigService.getProducts().map(x => ({ 'value': x.ID, 'label': x.Name }));
}
}
しかし、アイテムをバインドするように見えるdoes notの。助けてもらえますか?