sort in timelineview

Hi,

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

$list = new OptionsConnector($res);
$list->render_table("table","id","id(value),name(label)");
$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:

Hi,
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: