question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Sorting broken on 0.3.2

See original GitHub issue

Just upgraded from 0.2.13 to 0.3.2 to benefit from the latest data.index fix on b-table (which works) but the sorting seems now broken

<template>
    <b-table
        :items="items"
        :fields="formFields"
        v-model:sort-by="sortBy"
        v-model:sort-desc="sortDesc">
    >
      <template v-slot:cell(name)="data">
        <span :class="`name_${data.index}`">{{ data.value }}</span>
      </template>
    </b-table>
</template>

<script>

export default {
  data(){
    return {
      sortBy: 'name',
      sortDesc: false,
      formFields: [
        {key: "name", sortable: true, label: "Name"},
        {key: "status", sortable: true, label: "Status"},
      ],
      items: [
        { name: "Jack", status: "Used" },
        {name: "Frank", status: "Unused"},
        {name: "Larry", status: "Used" },
      ],
    }
  },
}
</script>


Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
VividLemoncommented, Sep 12, 2022

Determine if the table will sort its internal items or you will sort the given items prop yourself which is useful when you want to sort the table through API request within the sorted event It was mentioned in this PR #594

And its default value changed to false based on this comment #609 (comment)

https://github.com/cdmoro/bootstrap-vue-3/commit/aac2b68f7bc8672246107c650e7c928dd336c201 Yeah, I turned it to true. I think my point was that it didn’t have a default value… But did not fully understand how it worked, which is why I mentioned make it false, default true is better since most people don’t need to sort by apis and stuff.

0reactions
VividLemoncommented, Sep 13, 2022

Update to 0.3.3 as sortInternal is default true, (fixes your issue). Or manually set prop sortInternal to true.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Surviving With Create 0.3.1 :: E26 - Storage & Sorting System
Today we set up a storage & sorting system using the Create mod. Items are sorted and placed into chests using a high...
Read more >
HParam table view sort not working · Issue #3041 - GitHub
sorting only works sporadically. Most of the time, it doesn't work at all, other times, sorting is applied to the previously selected column ......
Read more >
C++ sort 2 arrays pairwise [duplicate] - Stack Overflow
I was considering just making a tuple struct and packing these into a std:vector of tuples, overloading the sort comparator.
Read more >
OpenCart Community Forum
OpenCart doesn't abide by the option or option value sort order on the admin product edit or in the order invoices.
Read more >
Chapter 16 Arranging (Sorting) Data | R for HR
Arranging (sorting) data refers to the process of ordering rows numerically or alphabetically in a data frame or table by the values of...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found