lumber icon indicating copy to clipboard operation
lumber copied to clipboard

Any way to dynamically set enum values in smart action?

Open bidhan-a opened this issue 7 years ago • 12 comments

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.

bidhan-a avatar Aug 13 '17 03:08 bidhan-a

+1

grepsr avatar Aug 14 '17 10:08 grepsr

+1

pawelwiewiora avatar Jan 23 '19 07:01 pawelwiewiora

+1

sic-f avatar Jan 28 '19 11:01 sic-f

+1

MaddyCase avatar Feb 01 '19 17:02 MaddyCase

+1

htmathias avatar Mar 26 '19 05:03 htmathias

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

SeyZ avatar Mar 26 '19 08:03 SeyZ

Hi @SeyZ, what is the status of this feature?

natemoore3 avatar Aug 24 '19 19:08 natemoore3

+1

desi avatar Dec 17 '19 02:12 desi

Any news on this request please?

lmwattebled avatar Feb 12 '20 14:02 lmwattebled

This can be handled using reference attribute. { field: 'continent', reference: 'continent.id' }

Link to Doc is here

shriram-balakrishnan avatar Jun 25 '20 15:06 shriram-balakrishnan

Any update please ?

callanoc avatar Aug 08 '22 16:08 callanoc

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 ?

jgrantprog1993 avatar Feb 16 '23 22:02 jgrantprog1993