Skip to content
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

'multiple' type field #50

Open
pda-code opened this issue May 20, 2016 · 1 comment
Open

'multiple' type field #50

pda-code opened this issue May 20, 2016 · 1 comment

Comments

@pda-code
Copy link

pda-code commented May 20, 2016

Bravo!!!!

This is the most clever and advanced piece of code i found on the internet for easy form development based on schema metadata. Well done!!!

i have an issue on multiple as

            schema: [
                { property: 'Id', type: 'text', attr: { required: true }, columns: 2, addons: [{ icon: "fa fa-users" }] },
                { property: 'OrderDate', type: 'date', attr: { required: true } },
                { property: 'OrderNumber', type: 'text' },
                {
                    type: 'multiple',
                    columns:4,
                    fields: [
                        { property: 'NumberOfItems', type: 'text' },
                        { property: 'CustomerId', type: 'select', list: 'item.Id as item.LastName + " " + item.FirstName  for item in vm.extra.customers', attr: { required: true } }
                    ]
                }
            ]

and the result is
2016-05-20_1409

You algorithm must be recursive.

When a field is "mutliple" i suggest to have a label as all the other fields so it occupies space (on the left or top) and for the actual control you just re-run the algorithm for the 'fields' properrty (because a "multiple" field has fields)

This way you can create unlimited nested form structure perfectly aligned!

More over you can introduce a new field of type "content" where the user can specify HTML markup in case he wants some complete custom special control.

P.S Please can you explain further the colOffset, col e.t.c classes used as options?

@JustMaier
Copy link
Owner

@pda-code, I don't have a lot of time to work on this enhancement now, but if you're willing to take a stab at it, definitely submit a PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants