图1 :
图2:
图3:
问题陈述所在环境:angular最新版本下。
页面布局:左右布局。
图1. 此截图为进入页面时的初始状态,表格右侧滚动条未显示,为何?
图2.正常。
图3:表格右侧滚动条未显示
求解:点击按钮,如何使表格的滚动条一直有显示?
- // 表格初始化
- sheetName = '表1';
- hostStyle = {
- width: '900px',
- height: '100%'
- };
- backgroundColor = "white";
- columnWidth = 200;
- // 工作表格初始化
- workbookInit(args){
- console.log('args',args)
- let spread:GC.Spread.Sheets.Workbook = args.spread;
- let sheet = spread.getActiveSheet();
- this.spread=spread;
- this.sheet=sheet;
- }
- // 点击按钮,伸缩右侧面板
- nzCollapsedChange(spread) {
- let obj = this.ReportdesignService.comFunction(spread);
- obj.sheet.suspendPaint();
- let hostStyleClientWidth = document.getElementsByClassName('nz-content')[0].clientWidth +'px'; //想通过获取表格父级的宽度,重新赋值给hostStyle以达到动态改变表格宽度,使滚动条一直存在,也许是此思路不对
- this.hostStyle.width = hostStyleClientWidth;
- obj.sheet.resumePaint();
- spread.refresh();
- this.isCollapsed=!this.isCollapsed;
- }
复制代码
|