cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Working with Member Displaymode values

JBARLOW
Active Contributor
0 Kudos
314

I'm sure this is a simple-ish one - just can't suss it out.

I'm trying to get the member displaymode of dimensions in a table, then depending on the mode do other actions.

To get the current displaymode I use the code below:
(simply grabbing the display mode of the dimension in the first row)

var DIM = tbl_detail.getDimensionsOnRows()[0];
var MODE = tbl_detail.getDataSource().getMemberDisplayMode(DIM);

Console log shows me it's currently set to ID - DisplayId

What i'd like to do is something like:

if MODE === DisplayId then do something

else if MODE === DisplayDescription do something else

But I think I need to convert the returned mode to a string as currently I can't use the value in a script

Any idea how I can convert the value returned by the variable MODE into a string?
I've had a look at case / switch statements - but not really sure what i'm doing 😞

Accepted Solutions (1)

Accepted Solutions (1)

JBARLOW
Active Contributor
0 Kudos

Well I overcomplicated that 🙂

So simple - this code works

if(MODE === MemberDisplayMode.DisplayId)

Answers (0)