0
votes

I have a problem with a v-data-table that does not seems to update the totalt numbers of elements in the data-table (pagination):

this.$http.post('Ajax/get_rows',
{
    search:self.search,
    rows_per_page:self.pagination.rowsPerPage,
    current_page:self.pagination.page
})
.then(function(response)
{
    self.files = response.data.files.data;
    self.pagination.totalItems = response.data.files.total;
    self.total = response.data.files.total;
    console.log(self.pagination);
    console.log(response.data.files.total);
    console.log(response.data.files);
},
function(error)
{
    self.dialog_header = error.body.header;
    self.dialog_message = error.body.message;
    self.display_dialog = true;
})
.then(function ()
{

});

HTML:

  <v-data-table :headers="file_headers" :items="files"
               :search="search" class="elevation-1"
               :custom-sort="dateSort"
               :total-items="total"
               rows-per-page-text="Rows per page"
               :pagination.sync="pagination">

In the object declaration totalt is set to 0.

The response from the server says:

current_page: 1
from: 1
last_page: 155
per_page: 25
prev_page_url: null
to: 25
total: 3870

So the total seems correct, but does not get updated in the v-data-table. It only shows a '-' sign.

The pagination object seems to be set correctly:

descending: false
page: 1
rowsPerPage: 5
sortBy: "date"
totalItems: 3870

What could be the problem?

Thanks for any help!

1
What vuetify version you using? - ßiansor Å. Ålmerol
@ßiansorÅ.Ålmerol I am using version 1.5.5 - Araw

1 Answers

0
votes

So, seems that removing :search="search" solved the issue. https://github.com/vuetifyjs/vuetify/issues/3978