Skip to content
This repository has been archived by the owner on Jun 14, 2024. It is now read-only.

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

Open
bidhan-a opened this issue Aug 13, 2017 · 12 comments
Open

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

bidhan-a opened this issue Aug 13, 2017 · 12 comments

Comments

@bidhan-a
Copy link

bidhan-a commented Aug 13, 2017

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
Copy link

grepsr commented Aug 14, 2017

+1

@pawelwiewiora
Copy link

+1

3 similar comments
@sic-f
Copy link

sic-f commented Jan 28, 2019

+1

@MaddyCase
Copy link

+1

@htmathias
Copy link

+1

@SeyZ
Copy link
Member

SeyZ commented Mar 26, 2019

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
Copy link

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

@desi
Copy link

desi commented Dec 17, 2019

+1

@lmwattebled
Copy link

Any news on this request please?

@shriram-balakrishnan
Copy link

shriram-balakrishnan commented Jun 25, 2020

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

Link to Doc is here

@callanoc
Copy link

callanoc commented Aug 8, 2022

Any update please ?

@jgrantprog1993
Copy link

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 ?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests