UNPKG

vue-tables-2

Version:
20 lines (17 loc) 615 B
"use strict"; module.exports = function (colName, ev) { if (!this.sortable(colName)) return; this.setPage(1, true); if (ev && ev.shiftKey && this.orderBy.column && this.hasMultiSort) { this.setUserMultiSort(colName); } else { this.userMultiSorting = {}; this.orderBy.ascending = colName == this.orderBy.column ? !this.orderBy.ascending : this._initialOrderAscending(colName); this.orderBy.column = colName; this.updateState('orderBy', this.orderBy); this.dispatch('sorted', JSON.parse(JSON.stringify(this.orderBy))); } if (this.source == 'server') { this.getData(); } };