Vuetify: 1.1.1
Last working version: 1.0.19
Vue: 2.5.16
Browsers: Chrome 67.0.3396.99
OS: Windows 10
Change items property of a DataTable with v-pagination setup alongside datatable
this.pagination.totalItems to be updated with the corresponding dataset
this.pagination.totalItems retains original dataset length
https://codepen.io/tomdanizer/pen/aKMBgN
This happens when appending or completely changing the array dataset. Looks to be related with changes made in the data-iterable.js watchers in
https://github.com/vuetifyjs/vuetify/commit/511329179271f2e4baa1e59deec5178e33fbfcf4#diff-0732a7685c70efc7ecf6b367a2db2396.
Adding the itemsLength watcher back in seemed to fix, but unsure if there are any side-effects.
Because you are using external validation you will need to update the totalItems yourself.
https://codepen.io/johnjleider/pen/dKrzQB
I'm not sure if this is accounted for in @nekosaur 's rewrite but maybe we should add a watcher in data-iterable for items changes?
@johnleider A watcher on items is needed for sure - also I am running into this problem, I can't update it manually because of two things;
update event isn't firing when the data is updated@johnleider I just took a look into https://github.com/vuetifyjs/vuetify/blob/dev/src/mixins/data-iterable.js and there are only two scenario's totalItems is updated
initPagination()search is updated in the watcherMaybe just adding a watcher for this.items.length or this.items so when ever the list updates - the totalItems is also updated fixes this all together
I can take another look at this. I recall a watcher on items was giving me an issue, but I'll confirm. Maybe @nekosaur has some insight as well.
Hi. Have this been fixed? I have a query returning 50k rows but the pages are not updating with the totalItems.
nvm. I've got this working after add the search into the pagination:
pagination: {
search: "",
rowsPerPage: 10,
totalItems: 0
},
@nekosaur is this resolved for v2.0?
Most helpful comment
Because you are using external validation you will need to update the totalItems yourself.
https://codepen.io/johnjleider/pen/dKrzQB
I'm not sure if this is accounted for in @nekosaur 's rewrite but maybe we should add a watcher in data-iterable for
itemschanges?