Buy Now
Sign in

Advanced table display

Twincarb , January 17 2022, 15:34
T
Twincarb 125
January 17 2022, 15:34 #397770
I am currently migrating my CC6 & CF6 forms and views to CC7 and am trying to simplify some of my data views which are currently shared over 3 views. The 3 views are all related to each other the best example I can give is reading from 3 tables "category" "sub-category" "article" where one column in sub-category matches one column in the category table, and one column in the article matches a column in the sub-category table.

The visual view I would like to end up with is a table which doesn't repeat all of the data:

https://ibb.co/0XYSh1T

The above is how my table is currently displaying but is it possible that I have a single mention of the Cat and sub cat?
I know how to set up the database read, but what elements would I need in order to get the table filled in? That's presuming its possible!
I think that the post here is doing something similar, which is to be able to load details of the nested array into a field on the table.
below is a snippet of the debug.
In the table I have column 1 set up to show the JobType.job_type which is filled with the data from the main db read. But filling in the other columns in the correct format is alluding me. The next column in the row is a a relation to the db read and as seen below is gathered correctly.
            [var] => Array
(
[0] => Array
(
[JobType] => Array
(
[aid] => 7
[type] => Derriford Covid Centre
)

[JobOrgs] => Array
(
[0] => Array
(
[aid] => 43
[organisation_type] => 7
[organisation_name] => Private Address
[short_name] => Private Address
[address_1] =>
[address_2] =>
[town] =>
[county] =>
[postcode] =>
[address] =>
)

)

)
Thanks in Advance

Dave
GreyHead 65
January 18 2022, 12:57 #397785
Hi Dave,
For some reason image uploads aren't working here :-( Please can you post links to the images.
Bob
If you'd like to buy me a coffee or two, thank you very much
T
Twincarb 125
January 18 2022, 13:12 #397787
Hi Bob,
I have edited the original post with more details as well
Dave
S
shahabpk 96
February 09 2022, 05:50 #397943
If you can simulate yoyr requirements in a pure mysql query, then i suggest you to use SQL Data action in CF7 use it as data source in your table list
C
Colnem 427
February 09 2022, 07:16 #397945
If I'm not wrong, you can use SQL Data Action result directly in Table List or Dropdown because SQL Data Action has no model. You have to build a model with PHP Action.
If you have a soluce, I'm interested...
S
shahabpk 96
February 09 2022, 21:54 #397948
Hi colenem
You can use SQL data action directly in Table List. See the post below and what you should do to achieve it
https://www.chronoengine.com/forums/posts/t109554/p397547#p397547
C
Colnem 427
February 10 2022, 07:46 #397949
Hi, Thanks
I know this shortcode.
But how do you do to use in an Add Option Dropdown where Syntax is model.field? Or in a table field using two models?
On my side, I use a Php action to rebuild var with a model name. But if you are a soluce to use directly....
Thanks