-
-
Notifications
You must be signed in to change notification settings - Fork 399
UX FormCollection #90
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
ae5d325
c305f0c
5e6dd84
eea2313
f651d90
cc02076
dceb2cf
dfb54f8
9300cda
ec4342a
b4f40cd
0584757
abd2b8f
3996f3b
aaa6811
4791ff9
8539ff9
2d1ed04
1e3105d
0a9cc54
94be94c
c805c0e
e56d04b
7467cee
a8c730c
ecd774a
25d8306
8e5cd8a
3b110f9
c36157c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
Co-authored-by: jmsche <[email protected]>
- Loading branch information
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -30,8 +30,8 @@ | |
| <div data-controller="{{ dataController }}" | ||
| data-{{ controllerName }}-allow-add-value="{{ allow_add|json_encode }}" | ||
| data-{{ controllerName }}-allow-delete-value="{{ allow_delete|json_encode }}" | ||
| data-{{ controllerName }}-button-add-value="{{ block('button_add')|e }}" | ||
| data-{{ controllerName }}-button-delete-value="{{ block('button_delete')|e }}" | ||
| data-{{ controllerName }}-button-add-value="{{ block('button_add')|e('html_attr') }}" | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Think we should go here with We can create the button add prototype this way: // build form
$prototype = $builder->create('button_add', ButtonType, array_merge(['block_prefix' => 'collection_add_button'], $options['button_add_options']));
$builder->setAttribute('button_add_prototype', $prototype->getForm());
// build view
if ($form->getConfig()->hasAttribute('button_add_prototype')) {
$prototype = $form->getConfig()->getAttribute('button_add_prototype');
$view->vars['button_add_prototype'] = $prototype->setParent($form)->createView($view);
}This is similar how the prototype of the collection itself is created: This way we make sure the button using the form theme and we can use |
||
| data-{{ controllerName }}-button-delete-value="{{ block('button_delete')|e('html_attr') }}" | ||
| data-{{ controllerName }}-prototype-name-value="{{ prototype_name }}" | ||
| {{ block('widget_container_attributes') }} | ||
| > | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I find
-allow-add-valueandbutton-add-valueconfusing. I think I would just go withbutton-add-prototype. If it is set there is add if not there is no add else it could be confusing that I can set the prototype but its not used.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What I'm personally missing is a
-button-remove-target-selector. So I can adjust were the ux javascript will render target the button.