Hi,
I have problems in using the Grid inside an Angular project with strict mode on.
<kendo-grid
[data]="view | async"
[loading]="view.loading"
[pageSize]="state.take"
[skip]="state.skip"
[sort]="state.sort"
It complains that pageSize, skip and sort can't accept undefined values while the underlying State object can.
Thanks!
Hi Jagadish,
Let me provide a bit more information regarding the article that might be followed.
The reason for the raised error is that type "Observable<GridDataResult>" does not have a "loading" property. We add the "loading" property explicitly in order to check when the grid is loading:
export abstract class NorthwindService extends BehaviorSubject<GridDataResult> { public loading: boolean; ... protected fetch(tableName: string, state: any): Observable<GridDataResult> { const queryStr = `${toODataString(state)}&$count=true`; this.loading = true; return this.http .get(`${this.BASE_URL}${tableName}?${queryStr}`) .pipe( map(response => (<GridDataResult>{ data: response['value'], total: parseInt(response['@odata.count'], 10) })), tap(() => this.loading = false) ); } } ... }
We use this approach for demonstration purposes to help us decide when to display the loading spinner. However, the developer is in control of implementing his own approach. For example, the loading spinner may depend on a boolean component's property, which will be updated, when a request was sent and when we receive a response from the server.
I hope this helps.Such errors could also be avoided by adding the missing property to the type of the used Observable.
Also, the developer can explore our dedicated Loader component which is typically used to indicate ongoing operations in a more user-friendly way. For more details please refer to the following article:
https://www.telerik.com/kendo-angular-ui/components/indicators/loader/
Regards,
Martin
Progress Telerik