Open
Description
Can't set input widths using the grid classes per bootstrap documentation when using the horizontal-form class. As form-control class sets width to 100%, this overrides any grid class widths. Bootstrap documentation shows the need to wrap the input in a div. That way we can leave form-control at 100%. And I guess(?) allow a form def option to specify the class for this div, ie col-md-6. Can't set width to auto as that just brings up the need to reinvent the grid classes to apply to the input otherwise.
Activity
Anthropic commentedon Jul 3, 2016
Hi @kyse htmlClass should apply to the container div and fieldHtmlClass should be added to the input itself, unfortunately as I don't use bootstrap myself I need your help with understanding what else needs to change in the generated html if you have time to show me please?
kyse commentedon Jul 3, 2016
Add col-md-12 to a field class of a text box. Add a horizontal-form class to the form element. Your goal is to display the label and field inline. The purpose of using col-md-12 is to control the width of the field element. You'll notice the sizing doesn't work properly. The field element needs to be wrapped in a Div that has the col-md-12 class instead. Since the text input elements width is set to 100% the idea is to have it 100% of the containing element width which is set by the bootstrap grid classes.
slyadams commentedon Jul 27, 2016
@kyse, out of interest, have you even managed to get:
<form class="form-horizontal" sf-schema=".....>
Working at all?
kyse commentedon Jul 27, 2016
Yep, basically overwrote their templates in the bootstrap decorator to wrap input elements with div's containing a horizontalClass form binding.
slyadams commentedon Jul 28, 2016
Is there value in doing a PR for that? Does it break anything if you don't do horizontal forms?
rapkyt commentedon Sep 15, 2016
I have the same problem.
How did you do to overwrite their templates? I've tried with no luck
I never overwrited a template in Angularjs
kyse commentedon Sep 16, 2016
I basically created a file to overwrite the templateCache.
rapkyt commentedon Sep 19, 2016
It worked properly
Thanks!
dorinniscu commentedon Dec 9, 2016
It will be merged? It would be nice so we don't have to maintain an extra file. The bootstrap input really needs an wrapper no matter if we'll use it for horizontal alignment or will be an empty div.
chakraborty-slx commentedon May 18, 2017
@kyse Could you please take a look into this plunk, I am not able to apply the solution provided by you.
https://plnkr.co/edit/68TLAD
clmntr commentedon Aug 25, 2017
Hi,
What you can do is basically add your own template to the bootstrap decorator like described here.
For my problem, my solution was to add a new radios-multiple-inline (sounds weird, I don't assume that...) to the decorator, wrapping each radios labelled inside a div and adding a "wrapperHtmlClass" property to the previous radios-inline in order to manipulate each radios :
The result is like that :
And called like that :
Or even like that :
Hope it helps.
EDIT: