Qlik Community

Qlik Sense Integration, Extensions, & APIs

Discussion board where members can learn more about Integration, Extensions and API’s for Qlik Sense.

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
akl
Honored Contributor

Re: Qlik Sense Extension - referencing custom dimension property

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.

akl
Honored Contributor

Re: Qlik Sense Extension - referencing custom dimension property

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

Re: Qlik Sense Extension - referencing custom dimension property

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
Contributor III

Re: Qlik Sense Extension - referencing custom dimension property

Old, but I have the same question. Bump.

erik_wetterberg
Valued Contributor III

Re: Qlik Sense Extension - referencing custom dimension property

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

Erik Wetterberg
https://extendingqlik.upper88.com/
jonvitale
Contributor III

Re: Qlik Sense Extension - referencing custom dimension property

humesh_sindpure
New Contributor II

Re: Qlik Sense Extension - referencing custom dimension property

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