Closed juanonsoftware closed 6 years ago
You can just create your own version of the views to override the default templates. Copy the one you want to change from the Templates project into your own /views/shared/formfactory/
directory.
If you want to make it conditional on an attribute, the PropertyVm Type which is the model for the views has a GetCustomAttributes() method you can use to get a custom attribute.
Does that make sense?
Sorry that I did not make a response sooner. I think of a more dynamic way such as:
I want row #1 of form has only 1 text input (use col-*-12)
I want row #2 will have 3 fields (such as one date, one dropdown, one text input) (use col--3, col--3, col-*-6)
Is it possible to put some logic into GetCustomAttributes to archive this ?
If you create a BootstrapColAttribute(int cols)
and add that to your properties, then create a custom Views/Shared/FormFactory/Form.Property.cshtml
to which looks for the attribute and adds the class if it is present, that might work.
Is your problem solved? Closing this issue as I assume it is?
I have the form displaying and working well but from UI part, can some fields be configurable to display in the same row? I want to add col-* class but do not know how to inject. It's great if you could provide some guide. Thanks a lot !!