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.

[Feature Request] Add option to VDataTable for Disable Sorting

See original GitHub issue

New Functionality

The DataTable component always sorts the first column if no other sorting config is passed. This adds extra client-side work, even if/when the assumption is correct.

I should be able to pass a default-sort="false" to the table, to let the data show exactly as it was received.

Here is a minimal representation of the behavior: https://codepen.io/lukeed/pen/MOYwEL

The feature is definitely a nice-to-have, but I should be able to opt out of it when needed, and without needing to provide an alternative sorting method.

Improvements

I should expect to see table rows in the order that my service returned. This also removes the need to have prior knowledge of how the external data will be pre-sorted and returned to me.

Bugs or Edge Cases it Helps Avoid

It allows me to render data exactly as it was received. It also prevents extra/unnecessary client-side sorting calculations. The sorting function takes place even if the rows are pre-sorted by first column value too.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:2
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
buckwheat24commented, Oct 30, 2017

Edit: Never mind, in reading this again, I think you’re just suggesting that you don’t want any pre (default) sort – not that you want to disable sorting altogether.

Original comment: In searching for a very similar thing, I ran across: https://github.com/vuetifyjs/vuetify/issues/442

I think it will provide a solution to what you’re looking for. Setting all the headers to sortable: false, like:

headers: [
        {
          sortable: false
        },
        {
          text: "Headline",
          value: "headline",
          align: "left",
          sortable: false
        }
      ],

seems to completely disable the sort. Hope it helps!

0reactions
blalan05commented, Mar 4, 2019

We kindly ask users to not comment on closed/resolved issues. If you believe that this issue has not been correctly resolved, please create a new issue showing the regression or reach out to us in our Discord community.

Thank you for your contribution and interest in improving Vuetify.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to remove sorting option from DataTables? - Stack Overflow
First, try setting "bSort" to false. Note that, this will disable sorting all around. $('#jTable').dataTable({ "bSort" : false } );.
Read more >
Disable sorting of one column — DataTables forums
I tried to disable sorting in my first column by setting "orderable" to false in my column definitions: $(document).ready(function() {
Read more >
Remove Sorting from Specific Column - DataTables - Makitweb -
In this tutorial, I show how you can remove sorting from a specific column from datatables pagination using an inbuilt option.
Read more >
Data table component - Vuetify
The v-data-table component is used for displaying tabular data. Features include sorting, searching, pagination, content-editing, ...
Read more >
Datatable disable sorting on particular column example
If you want to remove sorting arrows or disable sorting on specific columns in datatables library than you can do it using columnDefs....
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