|
@@ -222,7 +222,7 @@ var TREE_SHEET_HELPER = {
|
|
|
}
|
|
|
sheet.invalidateLayout();
|
|
|
},
|
|
|
- showTreeData: function (setting, sheet, tree) {
|
|
|
+ getTipCellType: function (setting) {
|
|
|
let TipCellType = function () {};
|
|
|
TipCellType.prototype = new GC.Spread.Sheets.CellTypes.Text();
|
|
|
TipCellType.prototype.getHitInfo = function (x, y, cellStyle, cellRect, context) {
|
|
@@ -245,7 +245,7 @@ var TREE_SHEET_HELPER = {
|
|
|
zoom = hitinfo.sheet.zoom();
|
|
|
let textLength = this.getAutoFitWidth(value, text, acStyle, zoom, {sheet: hitinfo.sheet, row: hitinfo.row, col: hitinfo.col, sheetArea: GC.Spread.Sheets.SheetArea.viewport});
|
|
|
let cellWidth = hitinfo.sheet.getCell(-1, hitinfo.col).width();
|
|
|
- let dataField = setting.cols[hitinfo.col].data.field;
|
|
|
+ let dataField = setting.cols && setting.cols[hitinfo.col].data.field || setting.header[hitinfo.col].dataCode;
|
|
|
|
|
|
if((tag==undefined||tag=='')&&hitinfo.sheet.getCell(hitinfo.row,hitinfo.col).wordWrap()==true){//显示其它列的标记为空并且设置了自动换行
|
|
|
return;
|
|
@@ -279,7 +279,9 @@ var TREE_SHEET_HELPER = {
|
|
|
TipCellType.prototype.processMouseLeave = function (hitinfo) {
|
|
|
TREE_SHEET_HELPER.hideTipsDiv();
|
|
|
}
|
|
|
-
|
|
|
+ return new TipCellType();
|
|
|
+ },
|
|
|
+ showTreeData: function (setting, sheet, tree) {
|
|
|
TREE_SHEET_HELPER.protectdSheet(sheet);
|
|
|
TREE_SHEET_HELPER.massOperationSheet(sheet, function () {
|
|
|
sheet.rowOutlines.direction(GC.Spread.Sheets.Outlines.OutlineDirection.backward);
|
|
@@ -292,7 +294,7 @@ var TREE_SHEET_HELPER = {
|
|
|
setting.cols.forEach(function (colSetting, iCol) {
|
|
|
sheet.setStyle(-1, iCol, TREE_SHEET_HELPER.getSheetCellStyle(colSetting));
|
|
|
if (colSetting.showHint) {
|
|
|
- sheet.getRange(-1, iCol, -1, 1).cellType(new TipCellType());
|
|
|
+ sheet.getRange(-1, iCol, -1, 1).cellType(TREE_SHEET_HELPER.getTipCellType(setting));
|
|
|
}
|
|
|
if(colSetting.formatter){
|
|
|
sheet.setFormatter(-1, iCol, colSetting.formatter, GC.Spread.Sheets.SheetArea.viewport);
|
|
@@ -608,7 +610,7 @@ var TREE_SHEET_HELPER = {
|
|
|
|
|
|
},
|
|
|
showTipsDiv:function (text,setting,hitinfo) {
|
|
|
- if (setting.pos && text && text !== '') {
|
|
|
+ if (text && text !== '') {
|
|
|
if(text) text = replaceAll(/[\n]/,'<br>',text);
|
|
|
if(!this._fixedTipElement){
|
|
|
let div = $('#fixedTip')[0];
|
|
@@ -649,7 +651,7 @@ var TREE_SHEET_HELPER = {
|
|
|
$(this._toolTipElement).width(divWidth);
|
|
|
}
|
|
|
let top = setting.pos.y + hitinfo.y - divHeight / 2 < 0 ? 0 : setting.pos.y + hitinfo.y - divHeight / 2;
|
|
|
- $(this._toolTipElement).css("top", top).css("left", setting.pos.x - divWidth);
|
|
|
+ $(this._toolTipElement).css("top", top).css("left", setting.pos.x - divWidth).css;
|
|
|
} else {
|
|
|
//计算显示的初始位置
|
|
|
/* 显示在单元格上方,三角形指向下的版本
|
|
@@ -661,6 +663,7 @@ var TREE_SHEET_HELPER = {
|
|
|
let left = setting.pos.x + hitinfo.cellRect.x;
|
|
|
$(this._toolTipElement).css("top", top).css("left", left).css("max-width","500px");
|
|
|
}
|
|
|
+ $(this._toolTipElement).css('z-index', 9999);
|
|
|
$(this._toolTipElement).show("fast");
|
|
|
TREE_SHEET_HELPER.tipDiv = 'show';//做个标记
|
|
|
}
|