如何根据在模板小部件中完成的选择在小部件中进行选择(JS 触发)

How to Do selection in a widget based on a selection done in a Template widget (JS triggered)

在 iccube v6 报告中,我有一个名为 « Map » 的模板小部件,它有一些触发事件的代码: “地图,选项,After Render”中的代码:

self.fireEvent(vizEventType.onSelection, new viz.event.SetSelectionEvent(members));

JS 代码,On Send Event :

function(context, $box, type, args) {
    context.fireEvent("MapZoneSelected",args)
    return args;
}

在报告 JS 中:

function consumeEvent( context, event ) {                                
if (event.name == 'MapZoneSelected') {
    var mapZoneSelected = event.value; // Just used to debug the passed values
} 
}      

所以,我看到 MapZoneSelected 事件触发良好...

在目标小部件中,do Set Selection 被定义为 MapZoneSelected 但是小部件不会根据该事件设置它的选择......有反应,但它只会清除任何先前的选择。

我不知道我哪里错了...

我已经使用将选择事件发送到图表小部件的小部件模板为您创建了一个示例报告。只需单击气泡,您就会看到图表小部件上应用的选择(支持多部分)。你可以在这里测试它:

https://demo6.iccube.com/icCube/doc/ic3report?ic3demo=&name=%2Fshared%2FWhosebug%2FWidget%20Template%20Fire%20Selection&menu=on