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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

amarnus’s picture

Title: Views default sort setting not respected when there are no columns to sort by default » Views default sort setting not respected when there is no column to sort by default

Minor change to issue title.

7wonders’s picture

Status: Active » Needs review

Works for me.

cdeces’s picture

Issue summary: View changes

Works for me too.
I have the results sorted by Views and Datatables sorting set to none.

JeebsUK’s picture

This also works for me.

JeebsUK’s picture

Status: Needs review » Reviewed & tested by the community
Elin Yordanov’s picture

Version: 7.x-1.0 » 7.x-1.x-dev
Assigned: Unassigned » Elin Yordanov
FileSize
427 bytes

Re-rolled for the current dev version

  • Commit e0603f0 on 7.x-1.x by pc-wurm:
    Issue #1379570 by amarnus: respect views default sorting when there is...
Elin Yordanov’s picture

Status: Reviewed & tested by the community » Fixed

Thanks @amarnus, I've committed the patch to the dev branch.

  • pc-wurm committed e0603f0 on 7.x-1.x, 7.x-2.x
    Issue #1379570 by amarnus: respect views default sorting when there is...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.