I make à chronoconnectivity list who requested table include user_id field. How display username in the same list ?
Thank you.
You will need to add a new "Model", set the relation type to "belongs To", foreign key to "user_id", and the table to "users" table, set the Model name to "User".
Then you can use User.username
Regards,
Max
Array
(
[0] => SELECT `Extension`.`id` AS `Extension.id`, `Extension`.`name` AS `Extension.name` FROM `jnew_chronoengine_extensions` AS `Extension` WHERE `Extension`.`enabled` = '1' ORDER BY `Extension`.`ordering` ASC
[1] => SELECT `Connection`.`id` AS `Connection.id`, `Connection`.`title` AS `Connection.title`, `Connection`.`params` AS `Connection.params`, `Connection`.`extras` AS `Connection.extras`, `Connection`.`published` AS `Connection.published` FROM `jnew_chronoengine_connections` AS `Connection` WHERE `Connection`.`title` = 'patronymes' AND `Connection`.`published` = '1'
[2] => SELECT COUNT(*) AS `patronymes.count` FROM `jnew_chronoengine_chronoforms_datatable_patronyme` AS `patronymes` LEFT JOIN `jnew_users` AS `User` ON `patronymes`.`user_id` = `User`.`id`
[3] => SELECT `patronymes`.`id` AS `patronymes.id`, `patronymes`.`patro_patronyme` AS `patronymes.patro_patronyme`, `patronymes`.`patro_variantes` AS `patronymes.patro_variantes`, `patronymes`.`patro_lieu` AS `patronymes.patro_lieu` FROM `jnew_chronoengine_chronoforms_datatable_patronyme` AS `patronymes` LEFT JOIN `jnew_users` AS `User` ON `patronymes`.`user_id` = `User`.`id` ORDER BY `patronymes`.`patro_patronyme` LIMIT 30
)
Where i have to put "User.name" in the Table for front list table to be show? Please a example
I used this in the HTML textarea: Listar.cliente:{Cliente.name}
The query is correct, what do you have under the "Columns list" box now ? are you sure that your "user_id" fields are populated with valid users ids ?
Yes I'm sure. But how list could display "username" field value from "jnew_users" table when the SQL request don't select it like show debug :
[3] => SELECT `patronymes`.`id` AS `patronymes.id`, `patronymes`.`patro_patronyme` AS `patronymes.patro_patronyme`, `patronymes`.`patro_variantes` AS `patronymes.patro_variantes`, `patronymes`.`patro_lieu` AS `patronymes.patro_lieu`, `patronymes`.`user_id` AS `patronymes.user_id` FROM `jnew_chronoengine_chronoforms_datatable_patronyme` AS `patronymes` LEFT JOIN `jnew_users` AS `utilisateurs` ON `patronymes`.`user_id` = `utilisateurs`.`id` ORDER BY `patronymes`.`patro_patronyme` LIMIT 30
)
This is my "Columns list" box for front : [attachment=0]ScreenShot.jpg[/attachment]
The "utilisateurs" model details : [attachment=1]ScreenShot2.jpg[/attachment]
and second part of "utilisateurs" model details : [attachment=2]ScreenShot3.jpg[/attachment]
Regards,
Max
Véronique.
Please clear the "Fields" box under all models, and try again, when this is done correctly you will be able to find both tables fields in the debug query!
Regards,
Max
