buefy icon indicating copy to clipboard operation
buefy copied to clipboard

Method of b-table to sort simply

Open mk-startialab opened this issue 4 years ago • 4 comments

Description

A method of b-table which sorts with argument like "default-sort" property (e.g. ['first_name', 'desc']). Not "initSort", because I do not want to sort initially.

Why Buefy need this feature

"initSort" needs "default-sort" property. This means the table will be sorted initially with "default-sort" value. The new sort method bring us programmatic sorting freely.

mk-startialab avatar Sep 30 '20 03:09 mk-startialab

You can use sort method but it needs a ref of table column

jtommy avatar Sep 30 '20 06:09 jtommy

@jtommy Thanks. like this?

this.$refs.somecolumn.sort('desc');

mk-startialab avatar Sep 30 '20 07:09 mk-startialab

No you have to se a ref to table and to a table column. Then this.$refs.table.sort(this.$refs.mycolumn) or get the column by this.$refs.table.newColumns

jtommy avatar Sep 30 '20 11:09 jtommy

@jtommy All right. Thanks a lot!

mk-startialab avatar Sep 30 '20 23:09 mk-startialab

I am closing this PR Because a "workaround" was found.

wesdevpro avatar Jan 13 '24 04:01 wesdevpro