Fixed Row

Fixed Row

gtsafasgtsafas Posts: 13Questions: 0Answers: 0
edited February 2010 in General
Im looking for a way to lock a row at the top no matter how it is being sorted. I want to be able to click it and it gets sent to the top of list and then things will be sorted underneath it. It would act like a header does. Is there an easy way to achive this?

Replies

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    Sort of... It's still sorting based (the order of the table rows in DataTables is entirely sorting based), but you get it to do exactly what you are looking for. THe key here is aaSortingFixed: http://datatables.net/usage/options#aaSortingFixed . You could have a hidden column with the values indicating which row should be the header (fnUpdate might come in handy) and aaSortingFixed pointed at this row. Then sorting will always occur on this column first, and the user selected columns second - thus giving the effect you are looking for.

    Regards,
    Allan
This discussion has been closed.