Qlik Community

Qlik Sense Integration, Extensions, & APIs

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

bekahbeets2003
Contributor

creating extension gives 'undefined' error.

I am using qliksense desktop and the devhub on 4848 to follow tutorials to create my first extension. However, I have been stumped for 3 days by this error. It happens when I click to select a dimension or measure.

createExtError.PNG

Contents of the js file:

define(["jquery", "text!./com-qliktech-helloworld.css","./d3.min"], function($, cssContent) {"use strict";

  $("<style>").html(cssContent).appendTo("head");

  return {

  initialProperties : {

  version: 1.0,

  qHyperCubeDef : {

  qDimensions : [],

  qMeasures : [],

  qInitialDataFetch : [{

  qWidth : 4,

  qHeight : 1000

  }]

  }

  },

  definition : {

  type : "items",

  component : "accordion",

  items : {

  dimensions : {

  uses : "dimensions",

  min : 2,

  max : 2

  },

  measures : {

  uses : "measures",

  min : 2,

  max : 2

  },

  sorting : {

  uses : "sorting"

  },

  settings : {

  uses : "settings"

  }

  }

  },

  paint : function($element,layout) {

  console.log($element);

  console.log(layout);

        }

  };

});

3 Replies
erik_wetterberg
Honored Contributor

Re: creating extension gives 'undefined' error.

Hi,

Try recreating the extension object (that is removing the one you have from the sheet and dragging your extension again into the sheet). This might happen if your extension object is created without the dimension and/or measure arrays.

Hope this helps

Erik Wetterberg

Erik Wetterberg
https://extendingqlik.upper88.com/
bekahbeets2003
Contributor

Re: creating extension gives 'undefined' error.

What do you mean create it without the dimension or measure arrays? Are you talking about in the js code or in the visualization on the desktop? Because I'm supposed to be able to add them from the desktop.

erik_wetterberg
Honored Contributor

Re: creating extension gives 'undefined' error.

In the property panel you add dimensions and measures to the arrays, but it does not create the arrays, that has to be done in initialProperties.

Erik

Erik Wetterberg
https://extendingqlik.upper88.com/