Re: [QuickForm] Groups within groups
| From: | Bertrand Mansion | Date: | Thu, 16 Oct 2003 19:25:59 +0000 |
| Subject: | Re: [QuickForm] Groups within groups | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-8468@lists.php.net to get a copy of this message | ||
<karhade@yahoo.com> wrote :
>> No, this feature is not available at the moment, it
>> is really difficult to
>> implement. And, most of the time, there are
>> workarounds.
> OK.
>
>> You can also try to avoid groups in groups by using
>> different names for your
>> elements such as group1_el1, group1_el2, group2_el1,
>> group2_el2... It all
>> depends on what exactly you are trying to do.
> OK. I am going to give the groups different names. I
> am struggling with how to lay them out in the form.
> The way I want it as follows.
>
> (SG stands for sub-group in the following example.)
>
> -------------------------------------------------
> Group label
> -------------------------------------------------
> SG1 label | SG1 elem 1 | SG1 elem 2 | SG1 elem 3
> SG2 label | SG2 elem 1 | SG2 elem 2 | SG2 elem 3
> SG3 label | SG3 elem 1 | SG3 elem 2 | SG3 elem 3
> -------------------------------------------------
>
> In other words, I really want to lay it out as a
> matrix, but the elements in a row should be treated as
> a group since I want them to be validated as a group.
> (The table should be created when the main group is
> added. For every SG, a row in the table should be
> added. And the table should be closed after that. How
> would I go about doing this using the dynamic
> renderer?
Well, you don't need subgroups for that. Just treat each rows as a group and
forget about the main group because apparently, it's just a label. If it's a
layout problem, then it can be solved in the template. You can use a special
header or a special static element for this label. Then use
setelementBlock() to specify how this header/static should be rendered.
http://pear.php.net/manual/en/package.html.html-quickform.html-quickform-ren
derer-itdynamic.setelementblock.php
Good luck,
Bertrand Mansion
Mamasam