Can I sort rows absolutely by their id?

Can I sort rows absolutely by their id?

aavaav Posts: 11Questions: 2Answers: 0

Hi, looking at this page, https://datatables.net/blog/2016-12-22 - only shows how to absolutely position rows based on strings. Can I select all <tr> with a certain id and put them at the bottom? Thanks

Answers

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

    Are you talking about an id in the data or a HTML id?

  • aavaav Posts: 11Questions: 2Answers: 0

    html id so like <tr id="absolute"> ...</tr>

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

    A HTML tag id has to be unique on the page.

  • aavaav Posts: 11Questions: 2Answers: 0

    how about by class then?

  • aavaav Posts: 11Questions: 2Answers: 0

    Alternatively, is it possible to take the date column, and put any dates in the past at the bottom absolutely?

  • allanallan Posts: 63,852Questions: 1Answers: 10,519 Site admin

    The last one you posted is probably the easiest. Have a look at this blog post.

    Allan

  • aavaav Posts: 11Questions: 2Answers: 0

    Sorry, this is the page I referenced in my original question - it has options for strings and numbers, but no explanation for a date

  • allanallan Posts: 63,852Questions: 1Answers: 10,519 Site admin

    Doh - sorry. Yes, the method described in that blog post would need to be extended to include support for dates. It could be merged with the Moment date / time plug-in potentially.

    Allan

This discussion has been closed.