Skip to content

table, sortable not working on on formated column #1173

Closed
@Miguel-Frazao

Description

@Miguel-Frazao

I have something like this:

...
<b-table :items="products_cart" :fields="fields">
    <template slot="actions" scope="data">
    	...
    </template>
</b-table>
....
props: ['products_cart'],
data() {
return {
	fields: [
		{
			key: 'name',
			label: 'Name',
			sortable: true
		},
		{
			key: 'qtd',
			label: 'Quantity',
			sortable: true
		},
		{
			key: 'total_price',
			label: 'Total',
			sortable: true,
			formatter: (value, key, item) => {
		             return item.qtd * item.value;
			}
		},
		{
			key: 'actions',
			label: 'Actions'
		}
        ],
}
},
...

It's working great, except the sortable on the formated column, the total_price. Any ideias why? And/or can I solve this?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions