Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DataTable sorting not working #4452

Open
chessparov opened this issue Jan 13, 2025 · 0 comments
Open

DataTable sorting not working #4452

chessparov opened this issue Jan 13, 2025 · 0 comments
Labels
BUG Something isn't working

Comments

@chessparov
Copy link

chessparov commented Jan 13, 2025

Vuestic-ui version: 1.10.3

Description

Describe bug here:

  • Sorting event doesn't get fired. If you put sortable set to true in the column options, the column effectively become sortable, but nothing actually happens. By checking the event: @sorted="(event) => console.log('Sort change:', event)" it doesn' get fired.

Reproduction

Here's the sample code you can use to reproduce the issue.

<script lang="ts">

export default {
  data() {
    return {
      currentTab: "tab1",
      currentSeries: 0,
      tabs: ["tab1", "tab2"],
      columns: {
        tab1: [
          { key: "name", label: "Name", sortable: true },
          { key: "test", label: "Test Column", sortable: true }
        ],
        tab2: [
          { key: "name", label: "Name", sortable: true },
          { key: "test", label: "Test Column", sortable: true }
        ]
      },
      items: {
        tab1: [[
          { name: "Alice", test: 3 },
          { name: "Bob", test: 2 },
          { name: "Charlie", test: 1 },
        ]],
        tab1: [[
          { name: "Alice", test: 3 },
          { name: "Bob", test: 2 },
          { name: "Charlie", test: 1 },
        ]]
      },
    };
  },
};
</script>

<template>
  <div>
    <VaDataTable
        :columns="columns[currentTab]"
        :items="items[currentTab][currentSeries]"
    />
  </div>
</template>

The same happens if you try using a custom handler or try passing a ref as items.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BUG Something isn't working
Projects
Status: Backlog
Development

No branches or pull requests

1 participant