Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
When we use the Datatables style plugin for a view and leave the column to default sort by as None, the view still sorts the first sortable column by default. The reason I think is that in the theme preprocessor, where the settings are moved to Javascript, the key aaSorting is not set until there is at least one row to default sort by.
Here is a small patch that seems to fix this issue.
Comment | File | Size | Author |
---|---|---|---|
#6 | views-default-sort-setting-not-respected-1379570-6.patch | 427 bytes | Elin Yordanov |
datatables.patch | 490 bytes | amarnus |
Comments
Comment #1
amarnus CreditAttribution: amarnus commentedMinor change to issue title.
Comment #2
7wonders CreditAttribution: 7wonders commentedWorks for me.
Comment #3
cdeces CreditAttribution: cdeces commentedWorks for me too.
I have the results sorted by Views and Datatables sorting set to none.
Comment #4
JeebsUK CreditAttribution: JeebsUK commentedThis also works for me.
Comment #5
JeebsUK CreditAttribution: JeebsUK commentedComment #6
Elin Yordanov CreditAttribution: Elin Yordanov commentedRe-rolled for the current dev version
Comment #8
Elin Yordanov CreditAttribution: Elin Yordanov commentedThanks @amarnus, I've committed the patch to the dev branch.