我目前正在 Qlik Sense 中使用 JavaScript 和 jQuery 构建混搭。我做了一些数据选择,并将它们放入变量对象中:
var CurrentSelec = app1.selectionState().selections;
console.log(CurrentSelec);`
console.log(typeof CurrentSelec);
Run Code Online (Sandbox Code Playgroud)
这是我在浏览器控制台上得到的结果:
我试图在 Foreach 中显示 qSelected 值:
我尝试过使用Javascript:
for(var index in CurrentSelec) {
console.log(index.qSelected);
}
Run Code Online (Sandbox Code Playgroud)
我尝试过使用 jQuery:
$.each(CurrentSelec, function(i, index) {
console.log(index.qSelected)
});
Run Code Online (Sandbox Code Playgroud)
但我的浏览器控制台不显示我的foreach日志。
您知道如何正确创建对象的foreach并在浏览器控制台上显示其内容吗?
问候。