|
@@ -143,14 +143,14 @@ class ManualColumnResize extends BasePlugin {
|
|
|
this.currentTH = TH;
|
|
this.currentTH = TH;
|
|
|
// getCoords returns CellCoords
|
|
// getCoords returns CellCoords
|
|
|
// const col = this.hot.view.wt.wtTable.getCoords(TH).col;
|
|
// const col = this.hot.view.wt.wtTable.getCoords(TH).col;
|
|
|
- // const col = this.hot.getColHeader().indexOf(TH.innerText);
|
|
|
|
|
- let col = 0;
|
|
|
|
|
- for (let i = 0; i < TH.parentNode.childNodes.length; i += 1) {
|
|
|
|
|
- if (TH.parentNode.childNodes[i] === TH) col = i;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- if (!TH.parentNode.childNodes[0].innerText.replace(/(\s| )/gi, '')) {
|
|
|
|
|
- col -= 1;
|
|
|
|
|
|
|
+ const text = TH.innerText.replace('\n', '<br>');
|
|
|
|
|
+ let col = this.hot.getColHeader().indexOf(text);
|
|
|
|
|
+ // 如果这里调大说明存在列头一模一样的情况,这时就直接用 html element里的顺序来
|
|
|
|
|
+ if (this.hot.getSettings().viewportColumnRenderingOffset >= 20) {
|
|
|
|
|
+ col = TH.cellIndex;
|
|
|
|
|
+ if (!TH.parentNode.childNodes[0].innerText.replace(/(\s| )/gi, '')) {
|
|
|
|
|
+ col -= 1;
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
const headerHeight = outerHeight(this.currentTH);
|
|
const headerHeight = outerHeight(this.currentTH);
|