-
Notifications
You must be signed in to change notification settings - Fork 81
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
Strategy needed for custom layout of Signum React controls #90
Comments
Hi Geraldo, Thank you for asking and sorry that there is still no official documentation for Signum React. The problem is well-supported. Raw BootstrapIf you take a look at http://getbootstrap.com/css/#forms there are different examples of layout.
Most of the changes are in how the Signum ReactFormControlSignum.React typical components, like
FormGroupStyleYou can control the behaviour using The different values values for export enum FormGroupStyle {
/// Unaffected by FormGroupSize
None,
/// Requires form-vertical container
Basic,
/// Requires form-vertical container
BasicDown,
/// Requires form-vertical / form-inline container
SrOnly,
/// Requires form-horizontal (default), affected by LabelColumns / ValueColumns
LabelColumns,
} You can set the properties in each component: <ValueLine ctx={ctx.subCtx(c => c.companyName) } formGroupStyle={FormGroupStyle.Basic} /> But this will require a lot of repetition so typically you set this in the context. render() {
var ctx = this.props.ctx.subCtx({ formGroupStyle: FormGroupStyle.Basic });
return (
<div>
<ValueLine ctx={ctx.subCtx(c => c.companyName) } />
<ValueLine ctx={ctx.subCtx(c => c.contactName)} />
<ValueLine ctx={ctx.subCtx(c => c.contactTitle)} />
</div>
);
} There are a lot of other useful things that you can set in the context, like export enum FormGroupSize {
Normal, //Raw Bootstrap default
Small, //Signum default
ExtraSmall, //Like in FilterBuilder
}
|
Hi Olmo, Thanks for the extensive and clear answer. Once you know how it's very simple to do. Regards, Geraldo. |
A lot of Signum React entity components are made using the Bootstrap grid. It has 2 columns for the label and 10 columns for the input. My company's styleguide dictates a different setup with the input stretching to full width and a label on top of it. This is a sample html for a rendered date field:
So basically I want to adapt a different alignment for all Signum React ontrols. What would a good strategy for doing this?
The text was updated successfully, but these errors were encountered: