Qlik Sense Extensions - 无法在属性面板中引用 Ref(错误?)
Qlik Sense Extenstions - Unable to reference Ref in properties panel (bug?)
我将以下扩展代码的属性导出到一个单独的文件中。根据文档,您应该能够在 layout
对象中引用 props.myTextBox
,但是当使用 uses: "dimensions",
构建属性部分时,不会返回,这是有意还是错误?
//Properties Panel setup
define( [], function () {
'use strict';
// *****************************************************************************
// Dimensions & Measures
// *****************************************************************************
var myTextBox = {
ref: "props.myTextBox",
label: "My text box",
type: "string"
};
var dimensions = {
uses: "dimensions",
items: {
myTextBox2: myTextBox, //Problem Here?
},
};
var measures = {
uses: "measures",
min: 1,
max:20
};
// *****************************************************************************
// Appearance section
// *****************************************************************************
var appearanceSection = {
uses: "settings"
};
// *****************************************************************************
// Main properties panel definition
// Only what is defined here is returned from properties.js
// *****************************************************************************
return {
type: "items",
component: "accordion",
items: {
dimensions: dimensions,
measures: measures,
appearance: appearanceSection,
}
}
});
绘画功能
paint: function ($element,layout) {
console.log(layout.props.myTextBox) //Undefined?
}
认为问题在于 ref
应该定义为:ref: "qDef.myTextBox"
var myTextBox = {
ref: "qDef.myTextBox",
label: "My text box",
type: "string"
};
添加后,您可以在每个维度 layout
中访问 myTextBox
属性
P.S. 更改定义后,确保在 sheet.
上重新添加扩展对象
我将以下扩展代码的属性导出到一个单独的文件中。根据文档,您应该能够在 layout
对象中引用 props.myTextBox
,但是当使用 uses: "dimensions",
构建属性部分时,不会返回,这是有意还是错误?
//Properties Panel setup
define( [], function () {
'use strict';
// *****************************************************************************
// Dimensions & Measures
// *****************************************************************************
var myTextBox = {
ref: "props.myTextBox",
label: "My text box",
type: "string"
};
var dimensions = {
uses: "dimensions",
items: {
myTextBox2: myTextBox, //Problem Here?
},
};
var measures = {
uses: "measures",
min: 1,
max:20
};
// *****************************************************************************
// Appearance section
// *****************************************************************************
var appearanceSection = {
uses: "settings"
};
// *****************************************************************************
// Main properties panel definition
// Only what is defined here is returned from properties.js
// *****************************************************************************
return {
type: "items",
component: "accordion",
items: {
dimensions: dimensions,
measures: measures,
appearance: appearanceSection,
}
}
});
绘画功能
paint: function ($element,layout) {
console.log(layout.props.myTextBox) //Undefined?
}
认为问题在于 ref
应该定义为:ref: "qDef.myTextBox"
var myTextBox = {
ref: "qDef.myTextBox",
label: "My text box",
type: "string"
};
添加后,您可以在每个维度 layout
中访问 myTextBox
属性
P.S. 更改定义后,确保在 sheet.
上重新添加扩展对象