Hi,
I'm trying to do some stuff with a Grid (like a refresh after updating the datasource) but I'm unable to call the grid in the component's code.
Here's the code:
export class AppComponent implements OnInit {
title = 'new-app';
@ViewChild('grid') public grid: GridComponent;
ngOnInit(): void { }
}
This produces the following error:
Property 'grid' has no initializer and is not definitely assigned in the constructor.
Can you show me how to initialize the grid object?
BTW I tried with
@ViewChild('grid') public grid: GridComponent = {} as GridComponent;
but then when I do this.grid.refresh() I get an undefined error at runtime.
Attach is a basic code example of the problem.
Attachment:
newapp_805dab08.zip