Hello,
I was wondering if you can sort by specific names within a column? Right now I have 4 specific names within the column, for argument sake lets say: (A, B, C, D)
I was wondering if i could sort this (A,C,B,D) with that column
$grid["sortname"] = "column_name"
$grid["sortorder"] = "A, C, B, D
Would i need to presort this within MYSQL statement?
Thanks!
2 Answers
You can use mysql syntax of field(col, val1, val2, …) e.g.
$opt["sortname"] = "FIELD(column_name, 'A', 'B', 'C', 'D', 'E')"
$opt["sortorder"] = ""
…
$g->set_options($opt);
Your Answer