sort in timelineview


I have some data in timeline view with rows downloaded from sql. Php code looks like this:

$list = new OptionsConnector($res);
$conn->set_options("table", $list);

I want to sort it by another row in db so i tried change render_table to render_sql.

$list->render_sql("select * from `table` order by `order` asc","id","id(value),name(label)");

And it doesn’t work. Scheduler knows how many results this query generate but they have no value and no label :frowning:

try to set aliases for id/name columns inside the sql query

$list->render_sql("select id as value, name as label from `table` order by `order` asc","value","value,label");

Thanks a lot. It works :slight_smile: