Any way to dynamically set enum values in smart action?
See original GitHub issueHello,
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.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:6
- Comments:11 (1 by maintainers)
Top Results From Across the Web
Smart Action form hooks - Dynamic enums on a referenced ...
I have tested dynamic enums. It works great for “normal” cases. However, are you able to manage the case when the enum values...
Read more >Generating Enums Dynamically - java - Stack Overflow
Actually it is possible to create enum instances dynamically, but it's a total hack, I wouldn't advise it at all - maybe you're ......
Read more >Auto-populate Enum Values with existing data
I have worked around this by creating a set of 'Master' records that are filtered out of the slices the user sees, and...
Read more >Configure Static and Dynamic List of Values Fields
You can add an option to a list of values field (checklist, radio button, or select) by specifying an action Append Option to...
Read more >AutoMapper.Extensions.EnumMapping
If you want to change some mappings, then you can use MapValue method. This is a chainable method. Default the enum values are...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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
Any update please ?