-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPictureURL.js
66 lines (63 loc) · 1.43 KB
/
PictureURL.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
define( ["qlik", "jquery", "text!./style.css"], function ( qlik, $, cssContent ) {
'use strict';
var Paint = true;
$( "<style>" ).html( cssContent ).appendTo( "head" );
return {
initialProperties: {
qListObjectDef: {
qShowAlternatives: true,
qFrequencyMode: "V",
qInitialDataFetch: [{
qWidth: 2,
qHeight: 50
}]
}
},
definition: {
type: "items",
component: "accordion",
items: {
dimension: {
type: "items",
label: "Dimensions",
ref: "qListObjectDef",
min: 1,
max: 1,
items: {
field: {
type: "string",
expression: "always",
expressionType: "dimension",
ref: "qListObjectDef.qDef.qFieldDefs.0",
label: "Field",
show: function ( data ) {
return data.qListObjectDef && !data.qListObjectDef.qLibraryId;
}
}
}
},
settings: {
uses: "settings"
}
}
},
support : {
snapshot: true,
export: true,
exportData : false
},
paint: function ( $element,layout ) {
var self = this, html = "<ul>";
layout.qListObject.qDataPages[0].qMatrix.forEach( function ( row ) {
var with1=$element.width()-15
var height1=$element.height()-15
html += '<img src="' + row[0].qText+'" width="'+ with1+'" height="'+height1+'" >';
html += '</li>';
} );
html += "</ul>";
$element.html( html );
Paint = false;
return qlik.Promise.resolve();
}
};
} );