Forums

Sortables in a view with Joins

Pkoll 21d ago

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 20d ago

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 20d ago

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 15d ago

Hi Max

Do you have a solution for this problem or not yet 

greetings

Paul

Max_admin 14d ago

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 14d ago

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 14d ago

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 14d ago

Hi Max,

The read data settings and table view

Max_admin 14d ago

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:

Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
Pkoll 14d ago

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

Pkoll 14d ago
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 13d ago

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.