Vuetify: External pagination count not synced upon table search

Created on 31 Aug 2017  路  5Comments  路  Source: vuetifyjs/vuetify

Steps to reproduce

  1. Open this codepen
  2. Search for anything (e.g Frozen )

Versions


Latest Vue, Vuetify
Browser: Latest Chrome on Windows 10

What is expected ?

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

What is actually happening ?

The pagination count is based on the initial set of items which is changes when you search in the table.

Reproduction Link

https://codepen.io/anon/pen/PKXQmY

bug

Most helpful comment

The total length is already exposed on pagination object in the totalItems property. However it was not correctly updating when searching.

All 5 comments

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..

Was this page helpful?
0 / 5 - 0 ratings