-
Notifications
You must be signed in to change notification settings - Fork 107
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
When add()/init() is called right after the object is created it should have no effect on the result. #1027
Comments
Currently the only way to change order of elements after they are added is to mess with |
Form rely on a layout View to add field and buttons. This layout view is added to the form template inside the Content tag. In your code above, when creating the form instance, initLayout method is called, thus inserting the layout view within the Content region of the form. Since the save button is part of the layout view, not the form view, and that it was added to the form template Content region first, then the button will always render first. Hope this help. |
@ibelar Thank you - yes, the issue with my example is that I added Dropdown to Form but the button is added to a layout... This moved the button to the end:
But when I changed the second line of the original example to add the Dropdown to layout like:
Then I received an Exception:
Is this a bug? I am using this for one use case where I do not need model, thus I do not / can not easily use |
@mvorisek - no - this is not a bug. When rendering the form layout, it see that the object is a field type and try to set caption on it. Not sure what you are trying to do but if you do not meed model, then why not just use form without model?
|
I need a html form and single dropdown element with save button. Nothing else. This works:
but the Field name ( To sum it up - I understand the logic, initially I tried to reorder elements in
I am still thinking calling Then reordering should not be needed that much thus renamed the title of this issue. |
Hi, if you want to hide the fields caption (in your case the X), you can use the parameter |
@PhilippGrashoff Thanks for pointing it out! It does not solve the that the result after But the property name |
I agree its confusing. More confusing even when regarding that Fomantic UI means by "inline" that the label is left of the input instead of above: @ibelar you are our form master. What do you think? |
Form layout is a custom view that relies on fields getInput and augments it with labels, captions etc. There is a class for a form without any layout engine or you can use custom form layout. |
@PhilippGrashoff - I believe class inline in Fomantic-UI is meant to be applied on a group of fields. Having the first field in the group to have its label set to the left of it and the remaining fields in the group to appear next to each other. |
@ibelar But in atk the |
We were discussing introducing hooks into the |
@mvorisek - sorry was not clear enough. It also has the same behavior for atk4/ui. Declaring 'inline' field does remove the label because it follow Fomantic-UI rule. See demos/form.php in Layout Control tab
|
@ibelar Ok, thanks for the demo, in atk, "noLabels" is only side effect of |
well, "inline" class in Fomatic-UI can be used two ways, at least 2 I know of:
|
Example:
Why is the save button (added in init, ie. before the dropdown is added initially) not moved to the end with the code above?
What is currently the best way to do so once the layout is initialized?
Currently
Form
supportsAboveFields
region. Wdyt to introduce region likeafterInit
for all elements that add some elements the the layout?The text was updated successfully, but these errors were encountered: