Qlik Community

Qlik Sense Integration, Extensions, & APIs

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

cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Contributor
Contributor

Qlik Sense Extension custom measure property Show / Hide

Hi All

I'm adding 2 custom properties on measures but I only want to display the second property based on the selection in the first, I have used show in appearance properties passing in data but not sure how I'd do that in measure custom properties, here is my code so far that works when you comment the show part:

measures: {
uses: "measures",
min: 1,
max: 10,
items: {
measuretype: {
type: "boolean",
component: "switch",
label: "Bar / Line",
ref: "qDef.measure.type",
options: [
{
value: true,
label: "Bar",
},
{
value: false,
label: "Line",
},
],
defaultValue: true,
},
measureaxis: {
type: "boolean",
component: "switch",
label: "Secondary Axis",
ref: "qDef.measure.axis",
options: [
{
value: false,
label: "Primary axis",
},
{
value: true,
label: "Secondary axis",
},
],
defaultValue: false,
show: function () {
if (!qDef.measure.type) {
return true;
}
},
},

},

Hopefully  you can see what I'm trying to do?  Please can you advise what I need to do to get this to work?

Thanks

Dom

1 Solution

Accepted Solutions
Highlighted
Specialist
Specialist

Re: Qlik Sense Extension custom measure property Show / Hide

Hi @Domski74 ,

Here this is a solution for your issue

---------------------------------------------------------------
show: function (e) {
if (e.qDef.measure.type) {
return true;
}else{
return false
}
}

---------------------------------------------------------------

View solution in original post

3 Replies
Highlighted

Re: Qlik Sense Extension custom measure property Show / Hide

The show function has parameters that containg the current values of the properties, so you need to check the content of those.

I don't think the parameters are well documented, so a first step would be to simple check the contents, like this:

show: function (data){

   console.log('show', data);

}

Hope this helps

Highlighted
Specialist
Specialist

Re: Qlik Sense Extension custom measure property Show / Hide

Hi @Domski74 ,

Here this is a solution for your issue

---------------------------------------------------------------
show: function (e) {
if (e.qDef.measure.type) {
return true;
}else{
return false
}
}

---------------------------------------------------------------

View solution in original post

Highlighted
Contributor
Contributor

Re: Qlik Sense Extension custom measure property Show / Hide

Hi

Thanks Ajay, I'd actually already figured this based on Erik's answer, but your answer is absolutely correct, thank you.  I'll mark yours as correct.

Cheers

Dom