Хо, я поставил пользовательский контроль внутри редактора ячейки сетки ag-grid?Пользовательский контроль внутри ячейки ag-сетки
Колонка Определение:
{
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 }));
}
}
Но он не кажется, связать элементы. Может кто-нибудь помочь?