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 AdvanceDave"> Advanced table display - Forums

Forums

Advanced table display

Twincarb 17 Jan, 2022
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?

https://ibb.co/3hZh90J

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 18 Jan, 2022
Hi Dave,

For some reason image uploads aren't working here :-( Please can you post links to the images.

Bob
Twincarb 18 Jan, 2022
Hi Bob,

I have edited the original post with more details as well🙂

Dave
shahabpk 09 Feb, 2022
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
Colnem 09 Feb, 2022
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...
shahabpk 09 Feb, 2022
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
Colnem 10 Feb, 2022
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
You need to login to be able to post a reply.