...
代码块 | ||||||
---|---|---|---|---|---|---|
| ||||||
//类型:ClientSide 事件:onBeforeRender function main(page: IPage, portlet: IFilterPortlet) { debugger; //初始化显示 table_switch(page,'2') // 选择值之后做切换 portlet.setFilterValueChangeHandler(function (value: any) { table_switch(page, value[0]); return value; }) function table_switch(page: IPage, title: string) { const table1: ITablePortlet = page.getPortletsByTitle('图表1')[0] as ITablePortlet; const table2: ITablePortlet = page.getPortletsByTitle('图表2')[0] as ITablePortlet; if (title == '1') { table1.show(); table2.hide(); } else if (title == '2') { table1.hide(); table2.show(); } } } |