...
代码块 | ||||||
---|---|---|---|---|---|---|
| ||||||
/* 对象:smartbix_page; 事件:onRender */ function main(page: IPage) { // 获取页签 let portlet = page.getPortletsByTitle('页签1'"页签_1")[0] as IStaticTabsPortlet // 获取参数的值 let otherPortlet = page.getPortletsByTitle('"参数'")[0] as IFilterPortlet if (!portlet || !otherPortlet) return otherPortlet.setFilterValueChangeHandler(function (value) { let a = value[0]; if (a == "test1") { portlet.setActiveTabName('1') } else if (a == "test2") { portlet.setActiveTabName('0') } else { portlet.setActiveTabName('2')} return value }) } |
page.getPortletsByTitle("页签_1")[0] 的“页签_1”可以通过图层查看具体页签组件的名称是什么,筛选器名称获取同理: