ForestAdmin / lumber

Install Forest Admin in minutes.
https://www.forestadmin.com
MIT License
2.07k stars 106 forks source link

Any way to dynamically set enum values in smart action? #104

Open bidhan-a opened 7 years ago

bidhan-a commented 7 years ago

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.

grepsr commented 7 years ago

+1

pawelwiewiora commented 5 years ago

+1

sic-f commented 5 years ago

+1

MaddyCase commented 5 years ago

+1

htmathias commented 5 years ago

+1

SeyZ commented 5 years ago

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

natemoore3 commented 5 years ago

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

desi commented 4 years ago

+1

lmwattebled commented 4 years ago

Any news on this request please?

shriram-balakrishnan commented 4 years ago

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

Link to Doc is here

callanoc commented 2 years ago

Any update please ?

jgrantprog1993 commented 1 year ago

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 ?