oruga icon indicating copy to clipboard operation
oruga copied to clipboard

Can't reset the sorting of the table component

Open theonelucas opened this issue 1 year ago • 1 comments

Oruga version: latest Vuejs version: latest

Description

In the vue2 version of Oruga, we could set the currently sorted column of a table by setting a reference to the <o-table /> component and mutating the prop currentSortColumn, eg.:

tableReference.value.currentSortColumn = {};

However, in the latest Oruga version (vue 3 / oruga 0.8.6), the <o-table /> component no longer exposes that prop, and the only prop remotely similar to that is the defaultSort, which is not two-way data bonded.

A two-way data bound prop or a method to change/reset the sorted column is desirable, as in our app we could reset the currently applied sorting, which now in the latest version no longer works.

theonelucas avatar Mar 25 '24 16:03 theonelucas

@theonelucas Thanks to open this discussion. Fyi, we switched from 0.8 to the composition api. A component written with <script setup> are closed by default, so you can't access internal data attributes and function anymore like component written with the option api before.

However, I will have a look at how we can provide a way to update the surrentSortColumn programmatically.

mlmoravek avatar Mar 27 '24 07:03 mlmoravek