Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
lmengesha
Partner - Contributor III
Partner - Contributor III

Dims & Measures missing additional properties

Hi Guys,

The problem im having is probably been asked before, basically I added specific properties to the dimensions and measures on creation (or addition), these properties allow me to know whether this dimension/measure is supposed to be hidden or not. The properties definition within the definition of the extension are the following:

return{

  type : "items",

  component : "accordion",

  items: {

            dimensions: {

                uses: "dimensions",

                min: 1,

                max: 5,

                items: {

                    hideDim: {

                        type: "string",

                        label: "Hide/Show by Expression",

                        expression: "always",

                        ref: "qDef.evaluate",

                        defaultValue: ""

                    },

                    hideCheckBox: {

                        type: "boolean",

                        label: "Select To Hide Dimension",

                        ref: "qDef.hide",

                        expression: "always",

                        defaultValue: false

                    }

                }

            },

            measures: {

                uses: "measures",

                min: 1,

                max: 10,

                items: {

                    hideDim: {

                        type: "string",

                        label: "Hide/Show by Expression",

                        expression: "always",

                        ref: "qDef.evaluate",

                        defaultValue: ""

                    },

                    hideCheckBox: {

                        type: "boolean",

                        label: "Select To Hide Measure",

                        ref: "qDef.hide",

                        expression: "always",

                        defaultValue: false

                    }

                }

            },

            appearance: {

                uses: "settings",

            }

        }

  };


If you guys see anything wrong with it please do let me know, also please do not forget to mention why my approach didn't work if you can.

The problem


Simple, The extra properties to each measure/dimension when added are visible within the properties panel but not added to the hypercubes qDimensionInfo and qMeasureInfo, is as if the properties are only visible within the panel, but as you can see in the code sample above the both properties are within qDef. I need to know what im doing wrong here.

1 Solution

Accepted Solutions
ErikWetterberg

HI,

As I thought, it's the problem that defaultValues are not initialized, only shown in the panel. In your case the hide parameter will be undefined, which in javascript is 'falsy',which means you could do:

if(dimensionInfo[0].hide){

.... hide logic

}

BTW, I'm not sure that expression: 'always' works for a boolean, never tried it.

Erik Wetterberg

View solution in original post

4 Replies
ErikWetterberg

Hi,

Not really sure what your problem is, but defaultValues basically only work in the property panel UI, meaning if there is no value, the property panel will display the default one. It will not fill in the property in the object with the value.

Erik Wetterberg

lmengesha
Partner - Contributor III
Partner - Contributor III
Author

I updated the post as I forgot to add a description of the problem, sorry about that.

ErikWetterberg

HI,

As I thought, it's the problem that defaultValues are not initialized, only shown in the panel. In your case the hide parameter will be undefined, which in javascript is 'falsy',which means you could do:

if(dimensionInfo[0].hide){

.... hide logic

}

BTW, I'm not sure that expression: 'always' works for a boolean, never tried it.

Erik Wetterberg

lmengesha
Partner - Contributor III
Partner - Contributor III
Author

Yep, yet again you are right sir.