Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Qlik Sense Extension - referencing custom dimension property

Hi everyone.

I'm trying to extend the workbench table template. I'm attempting to add a user modifiable cColWidth property for every dimension.

I have been able to add the cColWidth property to qDimensions in qHyperCubDef, and I can add the property to the dimension properties panel, but I'm not sure how to formulate the reference syntax, i.e. ref = "...".

Any help appreciated.

input.pngoutput.png

7 Replies
Alexander_Thor
Employee
Employee

You don't need it on the HyperCube.
Instead just define it in your definition and it will be available on the layout.

For example this item in a definition,

positive: {

     ref: "waterfall.positivecolor",

     label: "Positive",

     type: "string",

     expression: "optional",

     defaultValue: "rgb(68,119,170)"

}

would be available on layout.waterfall.positivecolor in your paint function or on $scope if you are doing an angular extension.

It's generally a good idea to prefix your custom properties with something, in this case waterfall, to avoid clashing with any properties we might add in the future.

Alexander_Thor
Employee
Employee

Oh just to answer your question also
When you are messing with the standard dialog there is most likely a top-level reference.

The references are cascading so for example the dimension panel already has a ref value of qHyperCube.qDimensions

so any child of that component does not need to reference the full path.

So the Limitation component would have a ref of qOtherTotalSpec.qOtherMode and since its parent has a ref of qHyperCube.qDimensions we will just figure that out for you and build the entire chain.

Not applicable
Author

The problem I'm facing is that the number of dimensions are dynamic, and I don't know how to access the n-th property.

Ideally I'd like to use: qHyperCube.qDimensions.cColWidth

Alternatively, if I don't leverage off the Hypercube's dimensions, how do I build a property panel with a dynamic number of properties.

For example, if I have only 2 dimensions, I would like to see only 2 sliders for ColWidth.

If I have 4 dimensions, I would like to see 4 sliders.

etc.

jonvitale
Creator III
Creator III

Old, but I have the same question. Bump.

ErikWetterberg

Hi,

Ref should be something like 'qDef.whatever'. The actual (evaluated) value will then be available in the qDimensionInfo array.

Hope this helps

Erik Wetterberg

jonvitale
Creator III
Creator III

humesh_sindpure
Partner - Contributor III
Partner - Contributor III

colorExpression:{

  type: "string",

  label: "Enter color expression",

  ref:"qHyperCubeDef.qDimensions.0.qAttributeExpressions.0.qExpression",

  expression:"optional"

  }

how do I call   this ref: qHyperCubeDef.qDimensions.0.qAttributeExpressions.0.qExpression",  in function