Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Datatable select method ORDER BY clause

I 'm trying to sort the rows in my datatable using select method. I know that i can say

datatable.select("col1='test'") 

which in effect is a where clause and will return n rows that satisfy the condition.

I was wondering can i do the following

datatable.select("ORDER BY col1") ---col1 is the name of the column

I tried datatable.defaultview.sort() but didnt work

Any ideas on how to get around this issue. thanks

like image 626
jsp Avatar asked Aug 13 '09 22:08

jsp


1 Answers

Have you tried using the DataTable.Select(filterExpression, sortExpression) method?

like image 143
Forgotten Semicolon Avatar answered Sep 21 '22 19:09

Forgotten Semicolon