vue-good-table-nextvue-good-table-next
Home
Guide
GitHub
Home
Guide
GitHub
  • Introduction

    • Getting Started
  • Configuration

    • Table Options
    • Table Events
    • Search Options
    • Sort Options
    • Pagination Options
    • Column Options
    • Column Filter Options
  • Advanced Configuration

    • Customizations
    • Checkbox Table
    • Grouped Table
    • Server Side Table
    • Row Details Table
  • Style Configuration

    • Themes
    • Style Classes
    • Sass

Sort Options

Set of options related to table sorting

<vue-good-table
  :columns="columns"
  :rows="rows"
  :sort-options="{
    enabled: true,
    initialSortBy: {field: 'name', type: 'asc'}
  }">
</vue-good-table>

enabled

type: Boolean (default: true)

Enable/disable sorting on table as a whole.

<vue-good-table
  :columns="columns"
  :rows="rows"
  :sort-options="{
    enabled: true,
  }">
</vue-good-table>

initialSortBy

Update

initialSortBy now allows for sort by multiple columns

type: Object or Array

Allows specifying a default sort for the table on wakeup. Both field and type values are required.

<vue-good-table
  :columns="columns"
  :rows="rows"
  :sort-options="{
    enabled: true,
    initialSortBy: {field: 'name', type: 'asc'}
  }">
</vue-good-table>

multipleColumns

type: Boolean (default: true)

Enable/disable multiple column sort. Users can shift-click on multiple columns to sort by multiple columns. The first column in the array gets primary sort.

<vue-good-table
  :columns="columns"
  :rows="rows"
  :sort-options="{
    enabled: true,
    multipleColumns: true,
    initialSortBy: [
      {field: 'name', type: 'asc'},
      {field: 'age', type: 'desc'}
    ],
  }">
</vue-good-table>
Edit this page
Last Updated:
Contributors: Akshay Anand
Prev
Search Options
Next
Pagination Options