nicklockwood / FXForms

[DEPRECATED]
Other
2.93k stars 339 forks source link

[Feature Request] Selectable Add-List #423

Open frakman1 opened 8 years ago

frakman1 commented 8 years ago

Regarding the "Template Fields Example" project:

It would be ideal if there was a _selectable_ and sortable array feature. The idea is that a user could add, sort, edit and check-mark-style select a cell from a table of options all in one go. Currently, the user needs to be presented with one form (or inline list) to add users in, then another different form to select the users that were just added in the previous one. Ideally this would be a single control.

I realise that the right-most accessory view on such tables is being used to move and sort the fields so losing the sorting feature in favour of the checkmark would be OK.

Do you know if that is even possible?

nicklockwood commented 8 years ago

You'd need to create a custom cell type backed by a custom class with two fields: NSString *name and BOOL selected. Then you could create a template form consisting of fields of that type.

frakman1 commented 8 years ago

(Sorry for the stupid questions)

So for example, using a list that is defined as such within the fields method:

  @{FXFormFieldKey: @"sortableArray", FXFormFieldTitle:@"List", FXFormFieldSortable: @YES,  FXFormFieldTemplate: @{FXFormFieldTitle: @"Add Name" } },

which part would change to specify the new field type I would be adding?