Vue-material: [mdTable] Setting md-total disables pagination on md-table-pagination

Created on 10 Feb 2017  路  8Comments  路  Source: vuematerial/vue-material

Hi,

On md-table-pagination setting md-total to a value changes the "Many" text to the value but it disables next and previous page actions.

Not setted:
image

Setted:
image

I'm updating datasource of rows on pagination events so there always are less or equals rows from pageSize.

bug

Most helpful comment

This issue seems to be fixed in the develop branch, would be really nice to release it!

All 8 comments

I'm having the same problem, it's a bug https://github.com/marcosmoura/vue-material/issues/437

It looks like the totalItems property isn't updating
https://github.com/marcosmoura/vue-material/blob/master/src/components/mdTable/mdTablePagination.vue#L51

For a temporal fix you can copy the component and add a computed property or a watcher.

@mehyaa and @iwan-wijaya I hit the same problem too just now. It seems that, to get around this, you can set the total to the string 'Many' or a really high value. I prefer the former. The issue is that the criteria for the disabled attribute doesn't recalculate when its dependent properties are changed through paging.

See https://github.com/marcosmoura/vue-material/blob/master/src/components/mdTable/mdTablePagination.vue#L15

I am looking at spending some time fixing this. I'll update this thread if I do end up submitting a pull request.

EDIT: I just submitted a PR for this issue.

Hey, this seems to still be a bug. Not working in 0.7.4. Is someone looking in to it?

I ran into this issue myself.
The problem is in the component md-table-pagination in the watcher for mdTotal.
The line "this.subTotal = sub > val ? val : sub" is assigning a value to subTotal, but that's a computed property so it fails. Commenting out that line fixes it:

mdTotal (val) {
// const sub = this.currentPage * this.currentSize

    //  this.subTotal = sub > val ? val : sub
    this.totalItems = isNaN(val) ? Number.MAX_SAFE_INTEGER : parseInt(val, 10)
  }

This issue seems to be fixed in the develop branch, would be really nice to release it!

Any updates on whether this has made it in the next scheduled release?

hi - any updates on this bug? thanks.

Closing this issue as our focus is on the new 1.0.0 version.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

sergey-koretsky picture sergey-koretsky  路  3Comments

sandhose picture sandhose  路  3Comments

capttrousers picture capttrousers  路  3Comments

maryleloisa picture maryleloisa  路  3Comments

bryanspearman picture bryanspearman  路  3Comments