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

Select items should be able to be generated from a url #41

Closed
JonatanSalas opened this issue Jul 20, 2016 · 6 comments
Closed

Select items should be able to be generated from a url #41

JonatanSalas opened this issue Jul 20, 2016 · 6 comments
Assignees
Milestone

Comments

@JonatanSalas
Copy link
Member

We could add url metadata option to the select field, and the responsability for the select to fetch it's own resources.
This will be good in cases where you need to generate the select from data in a web service

@andrerpena
Copy link
Member

We should do 2 things:

  1. Make the options metadata compatible with 2 types: Array (As it is today) and a function that returns a Promise. This way we allow it to load data asynchronously.
  2. Create a url metadata from which the Select should get the options.

Bonus quest:
Interdependent Selects is a pretty common use case. Example: You got a Select for Province and a Select for City. The City only displays cities of the given province.

The obvious solution for the above problem is this:

    url: (m) => `/api/cities/${m.province}`

... but we could think of providing an alternative non-function alternative like:

    url: "/api/cities/:province" 

I'm not sure about the latest but that's an option.

@suchostone
Copy link

Hi! are you planning to deliver this feature soon? thanks!

@JonatanSalas JonatanSalas added this to the v1.0.0 milestone Jul 22, 2016
@suchostone
Copy link

Will Lookup component include this feature as well? Thanks.

@JonatanSalas
Copy link
Member Author

@suchostone, I need to define some things with @andrerpena and then I will start to work on this.

@JonatanSalas
Copy link
Member Author

We are now working on this redux-autoform/redux-autoform-bootstrap-ui#15

@JonatanSalas
Copy link
Member Author

I will close this issue since it's related to the UI project. Follow the referenced issue!

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

4 participants