Good day fellow devs,
I'm using the angular slickgrid library and I've tried adding the rowDetailView functionality provided.
my problem is that I can click to exspand the view but I can't close the view. as soon as I click on the symbol again to close/open the rowDetailView I get the following error :
ERROR
core.js:15723
TypeError: Cannot read property 'hostView' of undefined
core.js:15723
message:"Cannot read property 'hostView' of undefined"
stack:"TypeError: Cannot read property 'hostView' of undefined
at RowDetailViewExtension.push../node_modules/angular-slickgrid/fesm5/angular-slickgrid.js.RowDetailViewExtension.onBeforeRowDetailToggle (http://localhost:4200/vendor.js:169190:48)
at RowDetailView.<anonymous> (http://localhost:4200/vendor.js:169026:27)
at Event.notify (http://localhost:4200/vendor.js:357049:35)
at SlickGrid.handleClick (http://localhost:4200/vendor.js:355962:39)
at Event.notify (http://localhost:4200/vendor.js:357049:35)
at trigger (http://localhost:4200/vendor.js:361492:18)
at HTMLDivElement.handleClick (http://localhost:4200/vendor.js:363417:7)
at HTMLDivElement.dispatch (https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.slim.min.js:2:42347)
at HTMLDivElement.push../node_modules/slickgrid/lib/jquery.event.drag-2.3.0.js.$event.dispatch (http://localhost:4200/vendor.js:351849:30)
at HTMLDivElement.v.handle (https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.slim.min.js:2:40348)"
here is my gridOptions:
this.gridOptions = {
enableAutoResize: true,
enableSorting: true,
enableColumnReorder: false,
enableFiltering: true,
enablePagination: true,
enableAsyncPostRender: true,
asyncPostRenderDelay: 0,
rowHeight: 50,
enableCellMenu: true,
rowSelectionOptions: {
selectActiveRow: true,
},
enableRowDetailView: true,
datasetIdPropertyName: 'id',
rowDetailView: {
process: (item) => this.simulateServerAsyncCall(item),
loadOnce: true,
singleRowExpand: true,
useRowClick: false,
panelRows: this.detailViewRowCount,
preloadComponent: LoaderComponentComponent,
parent: this,
viewComponent: RowDetailViewComponent,
},
params: {
angularUtilService: this.angularUtilService,
}
};
Here is the simulateServerAsyncCall() method I use:
simulateServerAsyncCall(item: any) {
console.log('this is the item passed to the stimFunc: ' + JSON.stringify(item));
return new Promise((resolve) => {
if (this.businessClients === undefined) {
console.log('this company has no sites');
this.rowView.siteDataToPass = null;
} else {
console.log('its seems there might be a sight hiding somewhere');
this.rowView.siteDataToPass = this.businessClients[item.tenantId].sites;
}
resolve(this.businessClients);
});
}
if my frontend is needed it is here :
<div id="companiesGrid" class="col" style="margin-top:15px">
<angular-slickgrid appSlickgridTour gridId="compGridList" [columnDefinitions]="columnDefinitions"
[gridOptions]="gridOptions" [dataset]="dataset" (onAngularGridCreated)="angularGridReady($event)">
</angular-slickgrid>
</div>
I just can't seem to figure out if I'm missing something or if something else is the problem.
thanks all.