@@ -326,7 +326,7 @@ export class AngularSlickgridComponent implements AfterViewInit, OnDestroy, OnIn
326326
327327 // when we have a totalCount use it, else we'll take it from the pagination object
328328 // only update the total items if it's different to avoid refreshing the UI
329- const totalRecords = totalCount !== undefined ? totalCount : this . gridOptions . pagination . totalItems ;
329+ const totalRecords = totalCount !== undefined ? totalCount : ( this . gridOptions && this . gridOptions . pagination && this . gridOptions . pagination . totalItems ) ;
330330 if ( totalRecords !== this . totalItems ) {
331331 this . totalItems = totalRecords ;
332332 }
@@ -537,12 +537,13 @@ export class AngularSlickgridComponent implements AfterViewInit, OnDestroy, OnIn
537537 }
538538
539539 // the processes can be Promises or Observables (like Angular HttpClient)
540+ const totalItems = this . gridOptions && this . gridOptions . pagination && this . gridOptions . pagination . totalItems ;
540541 if ( process instanceof Promise && process . then ) {
541- process . then ( ( processResult : GraphqlResult | any ) => executeBackendProcessesCallback ( startTime , processResult , backendApi , this . gridOptions . pagination . totalItems ) )
542+ process . then ( ( processResult : GraphqlResult | any ) => executeBackendProcessesCallback ( startTime , processResult , backendApi , totalItems ) )
542543 . catch ( ( error : any ) => onBackendError ( error , backendApi ) ) ;
543544 } else if ( isObservable ( process ) ) {
544545 process . subscribe (
545- ( processResult : GraphqlResult | any ) => executeBackendProcessesCallback ( startTime , processResult , backendApi , this . gridOptions . pagination . totalItems ) ,
546+ ( processResult : GraphqlResult | any ) => executeBackendProcessesCallback ( startTime , processResult , backendApi , totalItems ) ,
546547 ( error : any ) => onBackendError ( error , backendApi )
547548 ) ;
548549 }
0 commit comments