Latest Vue, Vuetify
Browser: Latest Chrome on Windows 10
The pagination number should change based on search results.
When I search for "Frozen" which gives me 1 out of 10 items, the pagination count is 2 instead of 1,
Suggestion: Maybe provide another example in the docs which will sync the searched item count instead of the passed items to the table
pages () {
return this.pagination.rowsPerPage ? Math.ceil(this.items.length / this.pagination.rowsPerPage) : 0
}
Instead of this.items.length maybe there is a way to expose this.searchedItems.length
The pagination count is based on the initial set of items which is changes when you search in the table.
The total length is already exposed on pagination object in the totalItems property. However it was not correctly updating when searching.
Has this issue reappeared in V0.17? I'm getting this problem again and the above codepen shows the error
Please create a new issue using the issue creator
@johnboc boc I realized that there is indeed a bug. There is an undocumented parameter called "searchLength" that must be changed when external search is done, and it isn't.
it seems like when i add the search property to the v-data-table.. doing that directly, while setting totalItems seems to be the cause, is there a fix for this? I have other data tables where setting the totalItems does populate the pagination 0-25 of 150 results etc..
Most helpful comment
The total length is already exposed on pagination object in the
totalItemsproperty. However it was not correctly updating when searching.