Skip to content

Instantly share code, notes, and snippets.

@julianschmuckli
Last active October 23, 2018 07:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save julianschmuckli/10d1358c3267e3d50f1b43c58851a187 to your computer and use it in GitHub Desktop.
Save julianschmuckli/10d1358c3267e3d50f1b43c58851a187 to your computer and use it in GitHub Desktop.
This is a code snippet for the following QlikSense Discussion: https://community.qlik.com/thread/317568
//The props get loaded via "define"
return {
initialProperties: {
qHyperCubeDef: {
qDimensions: [],
qMeasures: [],
qVariables: [],
qInitialDataFetch: [{
qWidth: 10,
qHeight: 50
}]
},
qVariableListDef: {
qType: "variable",
qShowReserved: true,
qShowConfig: true
},
listItems: []
},
definition: props,
support: {
snapshot: true,
export: true,
exportData: true
},
paint: function ($element, layout) {
//My visualisation code
return qlik.Promise.resolve();
}
};
var appearanceSection = {
uses: "settings",
items: {
colors: colors,
images: images,
MyList: {
type: "array",
ref: "listItems",
label: "List Items",
itemTitleRef: "label",
allowAdd: true,
allowRemove: true,
addTranslation: "Add Item",
items: {
button: {
label: "Click me",
component: "button",
action: function (data) {
alert("click!");
}
},
label: {
type: "string",
ref: "label",
label: "Label",
expression: "optional"
},
textarea: {
label: "My textarea",
component: "textarea",
maxlength: 100,//you shouldn't write too much
ref: "myTextarea"
}
}
}
}
};
// *****************************************************************************
// Main properties panel definition
// Only what is defined here is returned from properties.js
// *****************************************************************************
return {
type: "items",
component: "accordion",
items: {
dimensions: dimensions,
measures: measures,
sorting: sorting,
appearance: appearanceSection
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment