Hello,
I would like to be able to dynamically set a class attributes for subfields of a Repeatable field I have defined in a role: App::Form::Role:Repeatable::People
Is that possible? In various documentation I've seen references to using build_update_subfields for similar attributes in Compound fields.
In the field below, I would like to set width attributes narrower and wider depending on which fields are displayed on a form.
narrow
has_field 'household_people.person.first_name' => (
label => 'First Name',
label_attr => {'class' => 'label-medium'},
do_wrapper => '1',
wrapper_attr => {
class=> ['col-xs-3', 'col-md-3'],
},
type => 'Text',
required => '1',
element_attr => {
class => ['input-sm'],
},
);
wider
has_field 'household_people.person.first_name' => (
label => 'First Name',
label_attr => {'class' => 'label-medium'},
do_wrapper => '1',
wrapper_attr => {
class=> ['col-xs-6', 'col-md-6'],
},
type => 'Text',
required => '1',
element_attr => {
class => ['input-sm'],
},
);
Thanks,
Mark