Cannot change order direction of fixed order column

Cannot change order direction of fixed order column

JamaurJamaur Posts: 87Questions: 10Answers: 0

The order direction doesn't change, when a user clicks on a column heading that has a fixed order. Although the classes seem to change from sorting_asc to sorting_desc.

A test case showing this issue is shown in the link below: http://live.datatables.net/zerihiju/1/edit (Try clicking the column heading Position)

Replies

  • tangerinetangerine Posts: 3,365Questions: 39Answers: 395

    "orderFixed" means what it says.

    From the docs:

    the ordering specified by this option will always be applied to the table, regardless of user interaction.

  • JamaurJamaur Posts: 87Questions: 10Answers: 0
    edited June 2015

    I know what the docs says. Still, why do the classes change. It seems it was intended that the user can change the order direction when clicking the column heading but the sort will not be removed, if clicking on another column heading.

    If not, this behaviour should be highly considered as a new option.

  • allanallan Posts: 63,760Questions: 1Answers: 10,510 Site admin

    The classes changed because the sorting has changed. As the documentation says, the orderFixed is applied before the user sort, and then the user sort after that. So it effectively becomes a multi-column sort. Hence why multiple columns show sorting class information.

    If you just want to specify an initial sort order that will be removed when the end user selected a different column to sort on just use order.

    Allan

  • JamaurJamaur Posts: 87Questions: 10Answers: 0

    Thanks for replying.
    Though I don't think we are on the same line. I am talking about having to the change just the sort direction (Asc or Desc) of a fixed order column. (All in the same column)

    The classes changed because the sorting has changed.

    The classes changed but no sorting has happened, as you can see in the test case above. (Position Column)

  • allanallan Posts: 63,760Questions: 1Answers: 10,510 Site admin

    I am talking about having to the change just the sort direction (Asc or Desc) of a fixed order column

    That is not possible. The fixed ordering is fixed. There is no option to change it at this time.

    That the classes change is a bug (updated text case which visually shows this). Thanks for letting me know about that.

    Allan

  • JamaurJamaur Posts: 87Questions: 10Answers: 0

    Thanks for understanding. Still, it could be interesting to let the user change the sort direction. (even as a separate option) Thanks again.

  • allanallan Posts: 63,760Questions: 1Answers: 10,510 Site admin

    For that you would just disable sorting on the other columns and allow normal sorting on the one you want to be "fixed". I don't plan to alter the fixed ordering to not be fixed :-).

    Allan

  • monicasilvamonicasilva Posts: 11Questions: 2Answers: 0
    edited June 2015

    Allan, another question.
    Can I reset the orderFixed options?
    An example. I have a table with n row gropuing. I want the user can sort the other columns but inside the row grouping order (not of the whole table). Besides users can change columns groupped: the table change and the row grouping order so.
    At this time I need to change the orderFixed. How can I do it?
    Thanks

  • allanallan Posts: 63,760Questions: 1Answers: 10,510 Site admin

    Sorry no - there is no API to modify the fixed sorting at this time.

    Allan

  • monicasilvamonicasilva Posts: 11Questions: 2Answers: 0
This discussion has been closed.