Forums

Get values of checkboxgroup and seperate them

SAGO 12 Sep, 2017
Hi,

I have a simple table and one of the columns are the values of a checkboxgroups.
These values are shown like ["first value","third value","sixth value"].
I'd like to show each value below each other so that the column doesn't get too wide.
Is it possible to remove the [" "] and the comma's and put for example a <br/> tag between them so they are show one below each other.

This is the live page with the connection: https://tinyurl.com/yb6bdpnm

This is how it is now. Take a look at the column Antwerpen:



This is a faked page with firebug as how I would like the column Antwerp to be shown. Antwerp is checkboxgroup as mentioned before:



Thanks in advance!
Max_admin 15 Sep, 2017
Hi Sago,

Assuming your field name is Model.antwerpen, you need to use the following in the "Fields views" box:
Model.antwerpen:{fn:php_name}

then create a php function, named "php_name" and use this code:

echo implode("\n", json_decode($this->get("table_view_name.row.antwerpen")));


Best regards,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
Twincarb 16 Sep, 2017
Hi Max,

I have just tried this out on one of my connections, also on a new form and connection to double check. I am not able to get it to work, which element is "Fields views"? Are you referring to the box "Columns views" in the Table - View?

I have substituted the elements with my own and below is the debug view:

Array
(
    [read_data1] => Array
        (
            [log] => Array
                (
                    [0] => SELECT `Data1`.`aid` AS `Data1.aid`, `Data1`.`user_id` AS `Data1.user_id`, `Data1`.`created` AS `Data1.created`, `Data1`.`modified` AS `Data1.modified`, `Data1`.`select1` AS `Data1.select1`, `Data1`.`checkboxes3` AS `Data1.checkboxes3` FROM `t4k9x_chronoengine_chronoforms_data_json-test` AS `Data1` LIMIT 100;
                )

            [var] => Array
                (
                    [0] => Array
                        (
                            [Data1] => Array
                                (
                                    [aid] => 1
                                    [user_id] => 492
                                    [created] => 2017-09-16 18:15:53
                                    [select1] => ["1","3","4"]
                                    [checkboxes3] => 
                                )

                        )

                    [1] => Array
                        (
                            [Data1] => Array
                                (
                                    [aid] => 2
                                    [user_id] => 492
                                    [created] => 2017-09-16 18:16:04
                                    [select1] => ["1","2","3","4","5","6"]
                                    [checkboxes3] => 
                                )

                        )

                    [2] => Array
                        (
                            [Data1] => Array
                                (
                                    [aid] => 3
                                    [user_id] => 492
                                    [created] => 2017-09-16 18:26:41
                                    [select1] => ["1","2","3"]
                                    [checkboxes3] => ["y"]
                                )

                        )

                )

        )

    [php_name] => Array
        (
            [returned] => 
            [var] => 
        )

)


Regards,
Dave
GreyHead 17 Sep, 2017
Hi Dave,

I think that it is Views > Detail List > Fields views

Bob
Max_admin 20 Sep, 2017
Hi,

Are you referring to the box "Columns views" in the Table - View?



Yes, but it looks like there is a problem with your PHP since no data is there, did you add your "table_view_name" in the code ?

Best regards,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
This topic is locked and no more replies can be posted.