Skip to content

Instantly share code, notes, and snippets.

View erikwett's full-sized avatar

Erik Wetterberg erikwett

View GitHub Profile
@erikwett
erikwett / finshed_rendering_basic.js
Created December 5, 2017 13:58
Simple example of finished rendering notification, from Qlik Sense help
paint : function() {
return qlik.Promise.resolve();
}
var defer = qlik.Promise.defer();
Highcharts.chart($element.find('div')[0], chartDef, function() {
// callback function called when Highcharts is ready
setTimeout(function() {
defer.resolve();
}, 1000); //one second delay was needed
});
return defer.promise;
if (this.backendApi.isSnapshot) {
chartDef.chart.animation = false;
chartDef.plotOptions = { series: { animation: false } };
}
@erikwett
erikwett / syslist_initialProperties.js
Created January 16, 2018 12:29
Initial properties to get system data and variable
initialProperties: {
moneyFormat: {
qStringExpression: '=MoneyFormat'
},
qMeasureListDef: {
qType: "measure",
qData: {
qMeasure: "/qMeasure"
}
},
@erikwett
erikwett / add_alt_state.js
Last active April 26, 2018 09:42
Add alternate state to Qlik Sense property panel
addons: {
uses: "addons",
items: {
advanced: {
label: "Advanced",
type: "items",
items: {
state: {
ref: "qHyperCubeDef.qStateName",
label: "State",
@erikwett
erikwett / add_alt_state_dropdown.js
Last active April 26, 2018 10:06
Alternate state field as a dropdown
state: {
ref: "qHyperCubeDef.qStateName",
label: "State",
type: "string",
defaultValue: "$",
component: "dropdown",
options: function () {
return qlik.currApp(this).getAppLayout().then(function (a) {
return a.layout.qStateNames.concat('$').map(function (state) {
return {
@erikwett
erikwett / create_alt_state.js
Last active April 26, 2018 16:26
Property panel code to add an alternate state
addstate: {
ref: "statename",
label: "Add state",
type: "string",
change: function (data) {
if(data.statename){
qlik.currApp().addAlternateState(data.statename);
}
}
}
@erikwett
erikwett / gist:256e52ece04dfce2dbbacf543d85c029
Last active July 17, 2018 07:46
property_panel_expression_always.js
width: {
type: 'string',
ref: 'width',
label: 'Width',
expression: 'optional'
}
@erikwett
erikwett / property_panel_dropdown_custom.js
Last active July 17, 2018 08:02
Qlik Sense extension: property panel dropdown with custom alternative
width: {
type: 'string',
component: 'dropdown',
label: 'Width',
ref: 'width',
options: [{value: '', label: 'Default'},
{value: 'fill', label: 'Fill'},
{value: 'custom', label: 'Custom'}]
},
customwidth: {
@erikwett
erikwett / property_panell_add_to_measure.js
Created July 17, 2018 14:16
Add your own property to the built-in measure property
measures: {
uses: "measures",
min: 1,
max: 6,
items: {
type: {
ref: "qDef.type",
type: "string",
label: "Type",
component: "dropdown",