Multi-column ordering fails in Firefox + Safari

Multi-column ordering fails in Firefox + Safari

arnorbldarnorbld Posts: 123Questions: 23Answers: 1

Hi guys,

I have a table that uses inline editing, but this shows up even if I do not add the editor. On the first column I define multiple columns sorting:

{targets:  [0], orderData: [0, 4]}

Column 1 has mixed alpha data in it, column 4 contains a date.

This works perfectly in Google Chrome and the Chromium Edge on Desktop. It completely fails in Firefox on desktop, Safari, Firefox and Chrome on iPad.

What happens is that INITIALLY the order is applied correctly. However, if I sort on ANY columns not specified in the sort order and then click on any of the headers in the sort order, absolutely nothing happens at all, except the direction arrow changes on the column. No sorting happens. This ALWAYS works in Chrome/Edge, NEVER in FireFox or Safari.

Even with just

{targets:  [0], orderData: [4]},

if fails on FireFox works in Chrome.

This is literally a show stopper for us as many of the users will be using iPad and may also be using FF on desktop.

Best regards,

This question has an accepted answers - jump to answer

Answers

  • arnorbldarnorbld Posts: 123Questions: 23Answers: 1

    Hi guys,

    The column 4 is a DATE column and it SEEMS that those just don't work at all. I can sort on an amount and it resorts on two columns correctly. I have two date columns and if I add either of those in with the sort on column 0 and then sort on some other column and go back to sort on column 0, nothing happens.

    I will set this up on the test site so you can check this out.

  • arnorbldarnorbld Posts: 123Questions: 23Answers: 1

    I have set up the site for you - old login information still applies. Select the top job (ASG100) and then click the "Get Task..." button below. Once it loads it's easier to set the bottom table to show "All" or 200 (either will show all the rows) The columns set in the sort order on the "Job" column is "Job - Start Date - Sequence" If you open this in Chrome that's exactly what you will see. If you open it in Firefox you'll see that the sequence is always Job - Sequence. The Start date is never included in the order.

  • kthorngrenkthorngren Posts: 21,125Questions: 26Answers: 4,916

    This blog discusses the recommended way to sort Date columns with Datatables. Let us know if it solves the problem.

    Kevin

  • arnorbldarnorbld Posts: 123Questions: 23Answers: 1

    Hi Kevin,

    I'm using Moment and single-column sorting works fine as far as I can tell, it is only multi-column sorting and only on non-Chromium browsers. Moment is included in the page and I have:

    jQuery.fn.dataTable.moment( 'MM-DD-YYYY' );
    

    Like I said, single column sorting works fine and this works with no problems on Chromium based browsers, Chrome and Edge.

  • arnorbldarnorbld Posts: 123Questions: 23Answers: 1

    Hi Kevin,

    I have also tried to change the locale in the call to moment:

    jQuery.fn.dataTable.moment( 'MM-DD-YYYY' ,'en-us');
    

    No difference. Works perfectly in Chrome, not in FF or Safari.

  • kthorngrenkthorngren Posts: 21,125Questions: 26Answers: 4,916
    Answer ✓

    Even without using the datetime-moment plugin that date format appears to work with orderData with Safari. See this example:
    http://live.datatables.net/degifeki/1/edit

    You can enable the plugin by removing the comment.

    Does the example work for you? Can you post a link to you page or update my test case to show the issue?

    Kevin

  • arnorbldarnorbld Posts: 123Questions: 23Answers: 1

    Hi,

    Thank you so much! Yes, it DOES work with and without the plugin. So there is something in my code that is causing this. Alan & Colin have a login to my test site, I can't open it up for public access.

This discussion has been closed.