-
Notifications
You must be signed in to change notification settings - Fork 556
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
Advanced Layout (Flex columns) in json schema #2472
Comments
you can pass FormlyConfig through {
"type": "object",
+ "widget": { "formlyConfig": { "fieldGroupClassName": "row" } },
"properties": {
"firstName": {
"type": "string",
+ "widget": { "formlyConfig": { "className": "col-6" } }
},
"lastName": {
"type": "string",
+ "widget": { "formlyConfig": { "className": "col-6" } }
},
}
} object.type.ts+ <div [class]="field.fieldGroupClassName">
<formly-field *ngFor="let f of field.fieldGroup" [field]="f"></formly-field>
+ </div> |
Hi, Can you, somehow, create multiple fieldGroups inside one object type? I would like to have a form like this (https://formly.dev/examples/other/advanced-layout-flex) but using json schema. Thank you |
yes, use |
thanks for the quick response, I have one more question. is there a possibility to define multiple fieldGroups inside an existing json schema? the map callback function iterates over fields defined in a properties object inside a json schema. can you define multiple properties objects so that when map callback function is called, I already have multiple fieldGroups? for example, the schema below creates one fieldGroup property : [firstName, lastName, age, bio, password, telephone]. I would like to have multiple fieldGroup properties inside one object field type. something like [firstName, lastName], [age, bio], [password, telephone]
|
@aitboudad I am really sorry to bother you, but can you give me an answer on the possibility of such implementation? It would be extremely helpful to me. |
Hi @dorijangrgic,
{
"title": "A registration form",
"description": "A simple form example.",
"type": "object",
+ "widget": {
+ "formlyConfig": {
+ "templateOptions": { "groups": ['firstName', 'lastName'], ['age', 'bio'], ['password', 'telephone'] }
+ }
}
} 2- Define a custom extension which adjust the field group based on |
Hi @aitboudad !! I am working on a similar issue of generating multiple fieldgroups from the json schema. Just wanted to know that with the approach that you have suggested of using custom extensions, Do we also need to use ngx-translate to map the JSON schema to fieldConfig ? |
Question
How can i make an advance layout like this:
https://stackblitz.com/edit/angular-yp4t9a?file=src%2Fapp%2Fapp.component.ts
but in json schema .
its possible to add 'fieldGroup' in a json schema? thanks!
The text was updated successfully, but these errors were encountered: