njleonzhang / vue-data-tables

A simple, customizable and pageable table with SSR support, based on vue2 and element-ui

Home Page:https://njleonzhang.github.io/vue-data-tables

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Non-server data-tables component not respecting 'default-sort' table option

ajm5774 opened this issue · comments

Online reproduce

https://jsfiddle.net/eyn2x0rf/

Expected Behavior

Non-server table defaultSort should apply sort when table is created

Current Behavior

Non-server table defaultSort doesn't seem to do anything

Steps to Reproduce

  1. Create non-server table with table id and name columns. Set default sort to name descending
  2. Populated table with data with id and name where the name is not already sorted in descending order.
  3. When the table is rendered, the name column will show as sorting in descending order, but it will not actually be sorted.

Detailed Description

Non-server table default-sort should apply sort when table is created.
When the table is created, we just need to call "handleSort" in DataTables.vue if a tableProps.defaultSort is provided.