order without orderable

order without orderable

capeckcapeck Posts: 23Questions: 5Answers: 0

I understand that ordering of data is done with datatables settings, not the editor. I need to order based on a hidden column and not have any visible columns able to be ordered. (It is a large table and keeping the order consistent is important for editing) . I set the order on the hidden column and set all the visible columns to orderable: false. Looks like this:

                 "order": [[ 19, 'asc' ]],
                columnDefs: [
                    { orderable: false, targets: [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18] }
                ],

Is this a reasonable solution or should I be going about it differently? Thanks.

This question has an accepted answers - jump to answer

Answers

  • colincolin Posts: 12,877Questions: 0Answers: 2,198
    edited October 18 Answer ✓

    Yep, that's a good way to go, the only change I'd make is to use _all for columnDefs.targets, see here,

    Colin

  • capeckcapeck Posts: 23Questions: 5Answers: 0

    Thanks for the help!

Sign In or Register to comment.