Skip to content

Instantly share code, notes, and snippets.

View erikwett's full-sized avatar

Erik Wetterberg erikwett

View GitHub Profile
dimension : {
type : "items",
label : "Dimensions",
ref : "qListObjectDef",
min : 1,
max : 1,
items : {
label : {
type : "string",
ref : "qListObjectDef.qDef.qFieldLabels.0",
initialProperties : {
qListObjectDef : {
qShowAlternatives : true,
qFrequencyMode : "V",
qSortCriterias : {
qSortByState : 1
},
qInitialDataFetch : [{
qWidth : 2,
qHeight : 50
//created from the mashup editor
app.createCube({
"qInitialDataFetch": [
{
"qHeight": 20,
"qWidth": 2
}
],
"qDimensions": [
{
app.createCube( {
"qInitialDataFetch": [
{
"qHeight": 400,
"qWidth": 8
}
],
"qDimensions": [
{ "qDef": {"qFieldDefs": ["CaseNumber"]} },
{ "qDef": {"qFieldDefs": ["Status"]} },
return {
type: "items",
component: "accordion",
items: {
dimensions: {
uses: "dimensions",
min: 1,
max: 1
},
measures: {
initialProperties : {
version: 1.0,
qHyperCubeDef : {
qDimensions : [],
qMeasures : [],
qInitialDataFetch : [{
qWidth : 2,
qHeight : 50
}]
}
//check if we are in personal mode(desktop) or not
var global = qlik.getGlobal( config ), isPersonalMode;
global.isPersonalMode( function ( reply ) {
isPersonalMode = reply.qReturn;
} );
/*..*/
if ( isPersonalMode ) {
app.doReload().then( function () {
app.doSave();
} );
function FieldList ( app ) {
/*....*/
app.getList( 'CurrentSelections', function ( reply ) {
me.selections = reply.qSelectionObject.qSelections;
//render since selections have changed
me.render();
//use qBackCount and qForwardCount to enable/disable back and forward buttons
$( "[data-qcmd='back']" ).toggleClass( 'disabled', reply.qSelectionObject.qBackCount < 1 );
$( "[data-qcmd='forward']" ).toggleClass( 'disabled', reply.qSelectionObject.qForwardCount < 1 );
} );
function reOrder ( vis, sortOrder, col ) {
// set the new column first in the new sortorder array
var newOrder = [col];
//append all other columns from the current sort order
sortOrder.forEach( function ( val ) {
if ( val !== newOrder[0] ) {
newOrder.push( val );
}
} );
var patches = [{
//getObject returns a promise, so we use the then method to get the model
app.getObject( tabid, id, options ).then( function ( model ) {
//save the model for future use
tabContainer.visualizations[tabid] = model;
//the title will be in the model
tabContainer.setTitle( model, tabid );
//the Validated event will be triggered when there is new data
//use it to update the title
model.Validated.bind( function () {
tabContainer.setTitle( this, tabid );