ratiw / vuetable-2

data table simplify! -- datatable component for Vue 2.x. See documentation at
https://vuetable.com
MIT License
2.16k stars 399 forks source link

Sort functionality in data mode. #563

Open lrembacz opened 5 years ago

lrembacz commented 5 years ago

I am using VueRouter with new VueTable-2 from next branch. Good work BTW!

I had a problem with injecting sortOrder object into this vuetable from localStorage and I have used addSortColumn for that.

There is a BUG i think.

    addSortColumn (field, direction) {
      this.sortOrder.push({
        field: field.name,
        sortField: field.sortField,
        direction: 'asc'
      });
    },

Shouldn't be direction taken from arguments?

For workaround there is a way to use it with

setSortColumnDirection (index, direction)
ratiw commented 5 years ago

@lrembacz Thanks for the catch. Sorry for the inconvenience.