问题
Is it possible to sort a datatable by a specific column when it first loads? Or does it need to be done using the DAO? When I put on ORDER BY in my SQL in my DAO, no data at all is returned in the datatable
回答1:
Solved it used sortOrder="DESCENDING" or sortOrder="ASCENDING" on the column you wish to have sorted when datatable first loads
回答2:
Just need to add this to options:
"aaSorting": [[ 5, "desc" ]]
来源:https://stackoverflow.com/questions/3787778/richfaces-datatable-sort-specific-column-on-load