- Notifications
You must be signed in to change notification settings - Fork217
是否能把行头列头设置成可自选的模式?是否能将合并单元格的功能做成真正的将合并后的单元格的数值进行相加,而不是只是简单的显示 附图#2797
annisFromchina started this conversation inIdeas
-
BetaWas this translation helpful?Give feedback.
All reactions
Replies: 1 comment
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
-
目前没开放配置, 感兴趣可以来个 PR, 比较简单. S2/packages/s2-react/src/components/switcher/dimension/index.tsx Lines 73 to 74 in73b9b6c
合并单元格的能力比较弱, 人力有限, 不是后续迭代的重点, 目前是是参考的 Excel 的行为 保留左上角的文字, 如你需要求和, 可以参考自定义合并单元格 的示例. classCustomMergedCellextendsMergedCell{// 重写绘制文本getFieldValue(){const[groupA]=this.spreadsheet.options.mergedCellsInfo||[]// 根据行列索引拿到合并之前单元格的值constfieldValues=groupA.map(({rowIndex, colIndex})=>{constmeta=this.spreadsheet.facet.getCellMeta(rowIndex,colIndex)returnmeta.fieldValue})constsum=fieldValues.reduce((a,b)=>a+b,0)returnsum}getTextPosition(){constdefaultTextPosition=super.getTextPosition()const{ x, y, width, height}=this.metaconsole.log(this.meta)return{ ...defaultTextPosition,// 重写文本位置// x: 0,// y: 0}}} 如果后续反馈的人较多, 会考虑内置, 欢迎 PR. |
BetaWas this translation helpful?Give feedback.
All reactions
0 replies
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment



