Sort DataTable programmatically?
-
In the DataTable component, does anyone know of a way to trigger a column sort programmatically, (as if the user had clicked on a particular column header?)
-
Instead of bothering to trigger a sort, I am just rearranging the array upon which the table is based, works just as well for my needs. In case this helps someone else:
methods: { sortedArray (items) { return this.items.sort((a, b) => b.date - a.date) },