How to get Enum caption in java script

0
Hi, I have gone through the API docs for the enum. it says to use getEnumCaption(), but I don't know how to write the code please give some sample code 
asked
3 answers
0

Hi Vijayakumar,

I don’t know getEnumCaption(), but I use getCaption().
 

My enum Language:

ENUM_Language

Caption      Name

Dutch          nl_NL

English        en_US

getCaption(ENUM_Language.nl_NL)
=> Dutch         

getCaption(ENUM_Language.en_US)
=> English   

suc7, Pascal    

answered
0

Hi Vijayakumar,

You can getEnumCaption by an entity instance and attribute name.  The "Common" in mx.meta.getEntity("Common.AdminSideBar") is module name. 

https://apidocs.rnd.mendix.com/10/client/mendix_lib_MxMetaObject.html#getEnumCaption

image.png

answered
0

Hi vijayakumar t,

In the nanoflow take your object -> take a string variable & find your enum by getCaption($CurrentObject/EnumValue) -> in the javascript use a string parameter & pass this string variable as parameter.

answered