Hi Max,
I have a table view of multiple database tables that are used together in a join.
Now I want to be able to sort a number of columns, but when I specify sortables nothing happens.
Do I have to specify the sort fields differently?
Greetings
Paul
Hi Paul
Where did you specify the sortables ? in the Table view or in the "Read Data" action ?
Hi Max,
I define them by the Read Data because in the tabel view your can’t define sortables when you use a data source like a {var:read-data}.
Paul
Hi Paul
I did not work with views before so I can not be sure, but did you try to alias the returned columns from the view and use that alias in the sortable ?
You should then check the debug for SQL statement generated, does it include the sortable info you have saved ?
Are you using a custom SQL statement or you select the DB View in the table dropdown in Read Data ?
Hi Max,
I don't know what you mean by the alias returned columns from the view. Can you give an example?
In the SQL statement there are no sortable . An example of the SQL
[read_data69] => Array ( [sql] => SELECT * FROM `atelier78_rel_cur_lid` AS `Main` INNER JOIN atl_bezetting_atelier78 AS `cursus` ON Main.cursus_id=cursus.id INNER JOIN atelier78_leden AS `lid` ON Main.lid_id=lid.id LIMIT 20 OFFSET 0 [returned] => Array ( [0] => Array ( [id] => 1 [aanmaak_datum] => 2025-04-13 [lid_id] => 1 [cursus_id] => 223 [creatie_datum] => 2025-04-07 [wijzigings_datum] => 2025-04-07 [dag_van_de_week] => Donderdag [dagdeel] => Middag [type_cursus] => vast
I use no custom SQL statement but I use the Join in the read_data. Maybe this helps you.
Greetings
Paul
Hi Paul
Could you please post screenshots of your Read Data settings ?
Hi Paul
The sortable setting will just make the column title clickable so that you can sort that column, if you need the list to be ordered by default then you need the "Order rules" behavior as shown:
Hi Max,
I know but when I use a Table name then I can define sortables in the view. When I use Data Source I can't.
Why is that?
Paul
Hi Max
I found the problem. I decibel the data source like always with {var:read_data22}. When I defilé it like read_data22, tien the problem is gone.
So thanks for your time. greetings
Paul
Hi Paul
Great, sorry, I did not notice this in the image you posted earlier