How to order by a string?

How to order by a string?

step7745step7745 Posts: 1Questions: 1Answers: 0

I have the column: STATE

STATE could assume this values : ACTIVE, AFK, BUSY, OFF.

I want to order([]) for STATE = 'ACTIVE'

Is it possible?

Answers

  • kthorngrenkthorngren Posts: 21,166Questions: 26Answers: 4,921

    Datatables will order by the values in the column. Are you asking how to set the order option? You would use something like order: [[2, 'asc']] where 2 is the STATE column number. The column numbers start at 0 so 2 would be the thrid column.

    Kevin

  • colincolin Posts: 15,237Questions: 1Answers: 2,598

    If you want specific ordering on that type, you can either create an ordering plug-in, examples here and here, or use columns.render

This discussion has been closed.