lumber
lumber copied to clipboard
Any way to dynamically set enum values in smart action?
Hello,
First of all, I'd like to ask if it's possible to pre-populate form fields in smart action using the model. I couldn't find an example anywhere so I don't know if that's supported. One of the table columns contains a list and I would like to pass it to the 'enums' property to make it dynamic. For example:
'use strict';
const Liana = require('forest-express-sequelize');
Liana.collection('country', {
actions: [{
name: 'Validate',
fields: [{
field: 'comment',
type: 'String'
},{
field: 'continent',
type: 'Enum',
enums: ['Africa', 'Americas', 'Asia', 'Europe', 'Oceania'] // this should come from the model
}]
}]
});
Thanks.
+1
+1
+1
+1
+1
We're currently working on a set of new Forest Admin's widgets with the possibility to suggest dynamic values from a dropdown. The next step for us is to set this widget available in smart action forms. Stay tuned
Hi @SeyZ, what is the status of this feature?
+1
Any news on this request please?
This can be handled using reference
attribute.
{ field: 'continent', reference: 'continent.id' }
Link to Doc is here
Any update please ?
Is this possible with multiselect?
I have done it with the
{ field: 'continent', reference: 'continent.id' }
But this can only allow one selected at a time. So is it possible to have a multi-select from the model ?