3 Replies Latest reply: Aug 17, 2015 6:59 AM by Rynhardt Haarhoff RSS

    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

        • Re: Qlik Sense Extension - referencing custom dimension property
          Alexander Karlsson

          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.

          • Re: Qlik Sense Extension - referencing custom dimension property
            Alexander Karlsson

            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.

              • 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[n].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.