Skip to content
This repository was archived by the owner on Apr 30, 2018. It is now read-only.
This repository was archived by the owner on Apr 30, 2018. It is now read-only.

Can't Reload Data for "Select" Fields #71

@gizmoboy

Description

@gizmoboy

Bountysource

We have a use-case where we need to reload the saved form data back into a form.

Based on a suggestion from kentcdodds, we are loading the saved datagram back into FormData when reconsituting the form like so:

$scope.formData = {
  firstName: 'Kent C.',
  lastName: 'Dodds'
};
$scope.formFields = [
  {
    key: 'firstName',
    type: 'text'
  },
  {
    key: 'lastName',
    type: 'text'
  }
];

This works great for most field types, but fails for select fields.

It would be very useful to be able to pre- and re-select the appropriate values for select items by passing in the matching object from their options array.

It would be even more flexible to allow value/default selection by name or value of the options array objects, perhaps via some kind of options overload. (e.g. { selectedValue: "foo", propertyName: "name" }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions