Open Rajivkumar1234 opened 4 years ago
@autoboxer Any suggestion to this sir ?
Is this going to be available in Keystone-5 @JedWatson
@Rajivkumar1234, a Select
field is expecting a defined set of options, so as far as I know in Keystone 4 there's no way to dynamically set the values. There may be a way to override the values by accessing and manipulating the field pre-render, but unfortunately I'm not aware of a way to do it.
something like this might be a good place to start: Compliance.fields.audience.__options
I would like to use a combobox at the adminUI with fields that come from a webservice. I was thinking on get the data with a pre 'find' hook and then override the options atribute at the 'audience' property in the Schema.
Schema
Hook Compliance.schema.pre('find', async function(next) { let audiences = await audienceService.getAudiences(); next(); })
But I didn't find the way to bind the data. Any ideas how this can be done?
Thanks