How to sort datable on style background property

How to sort datable on style background property

Dev75Dev75 Posts: 5Questions: 2Answers: 0

Hello,

I would like to sort my datable on the style background . It is possible? How ?
<td class="sorting_1" style="background: red;"></td>
<td class="sorting_1" style="background: white;"></td>

Best regards,
Sébastien

Answers

  • colincolin Posts: 15,240Questions: 1Answers: 2,599

    Hi @Dev75 ,

    You can use orthogonal data with columns.render to return the colour for the sort type - this will have that effect.

    Cheers,

    Colin

  • Dev75Dev75 Posts: 5Questions: 2Answers: 0

    i add a attribute data-order and i would like to filter on it :

    My dataTable has 5 columns and i want to filter on the five : "aoColumns": [ {}, {}, {}, {}, {targets: 0, "data": { _: "0.display", sort: "0.@data-order", type: "0.@data-order" } } ]

    I have an error message.. Any Idea?

  • colincolin Posts: 15,240Questions: 1Answers: 2,599

    Hi @Dev75 ,

    We're happy to take a look, but as per the forum rules, please link to a test case - a test case that replicates the issue will ensure you'll get a quick and accurate response. Information on how to create a test case (if you aren't able to link to the page you are working on) is available here.

    Cheers,

    Colin

This discussion has been closed.