angular-autoFields-bootstrap icon indicating copy to clipboard operation
angular-autoFields-bootstrap copied to clipboard

'multiple' type field

Open pda-code opened this issue 9 years ago • 1 comments

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?

pda-code avatar May 20 '16 11:05 pda-code

@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

JustMaier avatar Jun 05 '16 04:06 JustMaier