Prevent jquery datatable from overriding the initial sort order

RESOLVED FIXED

Status

Webtools
mediawiki-bugzilla
RESOLVED FIXED
4 years ago
4 years ago

People

(Reporter: emorley, Assigned: emorley)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

(URL)

Attachments

(1 attachment)

(Assignee)

Description

4 years ago
Filing this in bugzilla (original issue at: https://github.com/mozilla/mediawiki-bugzilla/issues/43) so I can set flags/track in my normal Bugzilla workflow.

glob wrote:
> if you provide an order parameter to a table, this isn't honoured in the table; it's always sorted by ID.
> 
> eg.
> 
> <bugzilla>
> {
> "keywords": "bmo-big bmo-goal",
> "keywords_type": "anywords",
> "priority": ["P1","P2","P3","P4","P5"],
> "include_fields": "id, priority, summary, status, resolution, assigned_to, keywords",
> "order": "keywords DESC, priority, bug_id"
> }
> </bugzilla>
> 
> the results are returned by bugzilla, and inserted into html in the correct order by the php plugin. they are then re-ordered by the jquery datatable, which i consider to be a bug.
> 
> as far as i can tell this can be fixed by setting aaSorting to an empty array when initialising dataTable
(Assignee)

Comment 1

4 years ago
Created attachment 8448953 [details] [review]
PR: Disable initial jquery datatable sort

This fixes issue #43, solution as suggested by http://stackoverflow.com/questions/4964388/is-there-a-way-to-disable-initial-sorting-for-jquery-datatables
Attachment #8448953 - Flags: review?(ckoehler)
(Assignee)

Updated

4 years ago
Attachment #8448953 - Attachment is patch: true
Attachment #8448953 - Attachment mime type: text/x-github-pull-request → text/plain
(Assignee)

Comment 2

4 years ago
Comment on attachment 8448953 [details] [review]
PR: Disable initial jquery datatable sort

(Changed to patch=1 to appease bugzilla-todos, but that breaks the redirect)
Attachment #8448953 - Attachment is patch: false
(Assignee)

Updated

4 years ago
Attachment #8448953 - Attachment is patch: true
(Assignee)

Updated

4 years ago
Attachment #8448953 - Attachment is patch: false
Attachment #8448953 - Attachment mime type: text/plain → text/x-github-pull-request
(Assignee)

Comment 3

4 years ago
Christie, do you have an idea when you might be able to take a look at this? :-)
Flags: needinfo?(ckoehler)
(In reply to Ed Morley [:edmorley] from comment #3)
> Christie, do you have an idea when you might be able to take a look at this?
> :-)

I don't, unfortunately. I'm backed up with a bunch of other tasks. 

Also, right now we don't have a way to test this without having WebOps apply directly to wiki-dev.allizom.org. 

Regular wiki working group meeting is next week and I will see if someone has time to review then.
Flags: needinfo?(ckoehler)
(Assignee)

Comment 5

4 years ago
(In reply to Christie Koehler [:ckoehler] from comment #4)
> Also, right now we don't have a way to test this without having WebOps apply
> directly to wiki-dev.allizom.org. 

The patch is a one line change that just adds a new pref to the page inline JS. Given it only affects the UI, would you object to me working with IT to try rolling it out, and rolling back minutes later if it doesn't work?
(In reply to Ed Morley [:edmorley] from comment #5)
> The patch is a one line change that just adds a new pref to the page inline
> JS. Given it only affects the UI, would you object to me working with IT to
> try rolling it out, and rolling back minutes later if it doesn't work?

No objections. Thanks for taking that on!
(Assignee)

Updated

4 years ago
Depends on: 1056090
(Assignee)

Comment 7

4 years ago
Deployed to test in bug 1056090 and works well, so calling this fixed :-)
Status: ASSIGNED → RESOLVED
Last Resolved: 4 years ago
Resolution: --- → FIXED
(Assignee)

Updated

4 years ago
Attachment #8448953 - Flags: review?(ckoehler)
You need to log in before you can comment on or make changes to this bug.