Hi again, the error I'm having:name: "actionFailure"
message: "Cannot read property 'cells' of undefined"
stack: "TypeError: Cannot read property 'cells' of undefined
at ContentRender.push../node_modules/@syncfusion/ej2-grids/src/grid/renderer/content-renderer.js.ContentRender.refreshContentRows (http://localhost:16318/vendor.js:152487:105)
at Render.push../node_modules/@syncfusion/ej2-grids/src/grid/renderer/render.js.Render.dataManagerSuccess (http://localhost:16318/vendor.js:156361:34)
at http://localhost:16318/vendor.js:156193:54
at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invoke (http://localhost:16318/polyfills.js:2749:26)
at Object.onInvoke (http://localhost:16318/vendor.js:53422:33)
at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invoke (http://localhost:16318/polyfills.js:2748:52)
at Zone.push../node_modules/zone.js/dist/zone.js.Zone.run (http://localhost:16318/polyfills.js:2508:43)
at http://localhost:16318/polyfills.js:3247:34
at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invokeTask (http://localhost:16318/polyfills.js:2781:31)
at Object.onInvokeTask (http://localhost:16318/vendor.js:53413:33)"
I´m using "@syncfusion/ej2-angular-grids": "^17.1.41",
my grid, html:
<ejs-grid #grid [dataSource]='dataGrid' *ngIf="dataGrid && dataGrid.result.length" [groupSettings]='groupOptions' [allowPaging]="true" [pageSettings]='pageSettings' [filterSettings]='filterOptions'
[allowSorting]="true" [allowFiltering]="true" [allowGrouping]="true" height=400 [allowResizing]='true'
(dataStateChange)='dataStateChange($event)' [rowHeight]='24' (queryCellInfo)='tooltip($event)' (actionFailure)="gridActionFailure($event)" >
<e-columns>
<e-column field='contact' headerText='Contact' textAlign='left' width=200></e-column>
[...other cols...]
</e-columns>
</ejs-grid>
the ts code is a big peace.. I have two ways to trigger the service (observable that loads the grid - not as subject - being subscribed).
[component class deff]
public groupOptions: GroupSettingsModel;
[component class ngOnInit]
this.groupOptions = { columns: ['contact'] };
[component function, I call this one form the ngOnInit, from a submit event and form a change event, the searchState is a custom request of mine, is not a DataStateChangeEventArgs, but I take some stuff from there as well in an event change]
public getGridData(searchState) {
this.service.getData(searchState).subscribe(res => {
this.dataGrid = res;
});
}
[service]
public getData(state: Request): Observable<any> {
const results = 'xyz';
const count = 'count';
return this.http
.post(`${this.baseUrl}api/users/getxyz`, state, this.httpOptions).pipe(
tap(res => console.log(res)),
map((response: any) => ({
result: response[results],
count: response[count]
}))
);
}
could you show me the proper way, in an angular grid load with observable, how to use the initial grouping?
like this one, with the initial grouping.
Thanks