forms-js / discussions

6 stars 0 forks source link

Arrays #9

Open mohsen1 opened 9 years ago

mohsen1 commented 9 years ago

Arrays are the most challenging aspect of this component.

Here are the questions regarding arrays:

bvaughn commented 9 years ago

This kind of overlaps with #10. We should probably discuss collections in one place (here? there?) only to avoid confusion.

mchapman commented 9 years ago

I see a distinction (both in visual and data representation) between arrays of strings and arrays of objects.

Add / remove there are more options with string arrays.

Auto add - from here strings1

Explicit add strings2

With objects I don't think I have seen an alternative to explicit add (from here: objects

Re-ordering Think this should be optional - it is quite heavy and not much use in some scenarios.

\ Clever things ** Maybe premature to address this?

@bvaughn I appear to have continued here. I had already started capturing screen shots when I saw your post,

bvaughn commented 9 years ago

There's a side-effect of implementing either of the add-methods above in forms-js though: it requires users to fully describe their data with validations. (We can't initialize an object unless we know all of its possible attributes.)

There's also a further-down-the-chain side effect, which is to say that.. it complicates our templating system. Unless we insist on auto-generating all of the form markup- something I am pretty strongly apposed to (but something we should discuss on another ticket, perhaps)- then implementing our own collections-management (like you've screenshot) would take away a users ability to customize the presentation of fields within a child object.