No automatic resorting

No automatic resorting

johnblythejohnblythe Posts: 92Questions: 21Answers: 2

hey hey!

i've got a DT sorting according to html5 data- attributes. once a user works on the item, however, the value may change. at that point, though, i don't want it to resort. is there a quick and easy way to turn off continued/automatic sorting on DT?

thanks!

Answers

  • allanallan Posts: 61,895Questions: 1Answers: 10,145 Site admin

    The next time DataTables does a full redraw it will resort the table - it is no way around that. The only option would be to not tell it that the data has changed (which I presume you are doing using row().invalidate() or similar).

    Allan

  • johnblythejohnblythe Posts: 92Questions: 21Answers: 2
    edited May 2015

    Cool, thanks for the info. Actually I'd failed to mention it is also employing Editor. So I've got something like this:

    {
                label: "Offer Item #",
                name: "offerItem",
                type: "select2",
                opts: {....
                onChange: function(e) {
                        // submit it
                        editor.submit();
                }
    

    Hopefully that is helpful in figuring out a good solution!

This discussion has been closed.