Qlik Community

Qlik Sense Integration, Extensions, & APIs

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

BradMazurek
New Contributor II

Extension API: mounted() and paint() discrepancy

Looking at the documentation for the Extension API's mounted() and paint() methods, both say the following:

$element

jQuery wrapper containing the HTML element where visualization should be rendered.

but the $element received by each are different. Based upon the documentation, I would expect them to be the same. What am I missing?

3 Replies
Highlighted
ErikWetterberg
Honored Contributor

Re: Extension API: mounted() and paint() discrepancy

Different wrappers around the same element? Or different elements?

BradMazurek
New Contributor II

Re: Extension API: mounted() and paint() discrepancy

It appears to me to be different elements (a sub-element) to be precise.

Annotation 2019-12-31 114025.png

The first of which returns the yellow div below and the second returns the green div.

 

Annotation 2019-12-31 114251.png

 

For completeness, here is the code I'm using:

mounted: function ($element) {
	console.log("mounted");
	console.log($element);
},
		
paint: function ($element) {
	console.log("paint");
	console.log($element);

 

 

ErikWetterberg
Honored Contributor

Re: Extension API: mounted() and paint() discrepancy

Interesting. Looks like you are right. I don't use mounted much, in most cases I need the layout, which for some reason is not a parameter to mounted.