miguelcobain / ember-yeti-table

Yeti Table
https://miguelcobain.github.io/ember-yeti-table
MIT License
61 stars 15 forks source link

Async pagination with unknown totalRows #387

Closed charlesfries closed 3 years ago

charlesfries commented 3 years ago

Is it possible to use the pagination features of this addon with a dataset of unknown size? I'm essentially trying to use the Prev/Next buttons sans the total entries count. Can I pass in my own values to enable/disable the pagination buttons myself?

cah-brian-gantzler commented 3 years ago

All the pagination data is yielded, so your worst case you could always write your own.

The pagination control takes a parameter of paginationData. This is provided in the default control from yeti, but you can always override it

   <row.cell colspan={{table.visibleColumns.length}}>
        <table.pagination @paginationData={{this.myData}}/>
      </row.cell>

Pagination data is an object that should have the following properties

{ 
    pageSize, 
    pageNumber, 
    pageStart, 
    pageEnd, 
    isFirstPage, 
    isLastPage, 
    totalRows, 
    totalPages 
}

Hope that gets you a start of where you need to go