Topic: Datatable pagination doesn't work without searching
                  
                  ISDev
                  pro
                  asked 7 years ago
                
Thank's
                
                  
                      
                      ISDev
                      pro
                        answered 7 years ago
                    
Hi,
I changed this in the setTimeout function and it seems to work finely:
                      
                      Kapsch
                      pro
                        answered 7 years ago
                    
Hi,
in the meanwhile, can you please provide a working example how to deal with pagination in case the datasource comes from a service asynchronously?
br\alex
                      
                      Damian Gemza
                      staff
                        answered 7 years ago
                    
Kapsch pro commented 7 years ago
Hi,
have same behavior like 4ntibala. Looks like MdbTablePaginationComponent can not handle the case when tableService.setDataSource() is used in async workflow. br\alex
                      
                      4ntibala
                      pro
                        answered 7 years ago
                    
onList() {
  this.dbService.getCases()
    .subscribe(cases => {
      for (let i = 0; i <= cases.length - 1; i++) {
        console.log(cases[i]);
        this.currentCases.push(cases[i]);
      }
    });
  this.tableService.setDataSource(this.currentCases);
  this.currentCases = this.tableService.getDataSource();
  this.previous = this.tableService.getDataSource();
}
                    
                      
                      
                      Damian Gemza
                      staff
                        answered 7 years ago
                    
FREE CONSULTATION
Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.
Resolved
- ForumUser: Pro
 - Premium support: No
 - Technology: MDB Angular
 - MDB Version: 6.2.3
 - Device: Terra
 - Browser: Chrome
 - OS: Windows 10
 - Provided sample code: No
 - Provided link: No