Sortables in a view with Joins

Pkoll 09 Apr, 2025

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

Max_admin 09 Apr, 2025

Hi Paul

Where did you specify the sortables ? in the Table view or in the "Read Data" action ?

Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
Pkoll 10 Apr, 2025

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

Pkoll 15 Apr, 2025

Hi Max

Do you have a solution for this problem or not yet 

greetings

Paul

Max_admin 15 Apr, 2025

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 ?

Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
Pkoll 15 Apr, 2025

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

Max_admin 15 Apr, 2025

Hi Paul

Could you please post screenshots of your Read Data settings ?

Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
Pkoll 15 Apr, 2025

Hi Max,

The read data settings and table view

Sortables in a view with Joins image 1

Sortables in a view with Joins image 2

Max_admin 15 Apr, 2025

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:

Sortables in a view with Joins image 3

Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
Pkoll 16 Apr, 2025

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

Sortables in a view with Joins image 4

Pkoll 16 Apr, 2025
Answer
1 Likes

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

Max_admin 16 Apr, 2025

Hi Paul

Great, sorry, I did not notice this in the image you posted earlier

Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
You need to login to be able to post a reply.

VPS & Email Hosting 20% discount
hostinger