Skip to content

Commit

Permalink
fix: pro-IUAPDESIGN-98:友云采:grid中title显示为id,renderType存在时取消td的title。
Browse files Browse the repository at this point in the history
  • Loading branch information
liuyk committed Oct 21, 2016
1 parent eafb2dc commit fe1160a
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 25 deletions.
22 changes: 11 additions & 11 deletions dist/js/u-grid.js
Expand Up @@ -1834,7 +1834,7 @@
if (this.options.headerColor) {
colorStype = 'style="color:' + this.options.headerColor + '"';
}
htmlStr += '<div class="u-grid-header-link" field="' + this.options.field + '" title="' + this.options.title + '" ' + colorStype + '>' + this.options.title + '</div>';
htmlStr += '<div class="u-grid-header-link" field="' + this.options.field + '" ' + colorStype + '>' + this.options.title + '</div>';
/*if(oThis.options.columnMenu && createFlag != 'fixed'){
// 创建右侧按钮图标
htmlStr += '<div class="u-grid-header-columnmenu uf uf-reorderoption " field="' + this.options.field + '" style="display:none;"></div>';
Expand All @@ -1856,7 +1856,7 @@
var wh = $('#' + this.options.id)[0].offsetHeight;
this.wholeHeight = wh;
if (wh > 0) {
this.contentHeight = parseInt(wh) - this.exceptContentHeight > 0 ? parseInt(wh) - this.exceptContentHeight : 0;
this.contentHeight = parseInt(wh) - this.exceptContentHeight - 1 > 0 ? parseInt(wh) - this.exceptContentHeight - 1 : 0;
if (this.contentHeight > 0) {
h = 'style="height:' + this.contentHeight + 'px;"';
}
Expand Down Expand Up @@ -2176,7 +2176,7 @@
iconStr = '<span class="' + this.options.icon + '"></span>';
}
// title="' + v + '" 创建td的时候不在设置title,在renderType中设置,处理现实xml的情况
htmlStr += '<td role="rowcell" ' + tdStyle + ' title="' + v.replace(/\</g, '\<').replace(/\>/g, '\>') + '"><div class="u-grid-content-td-div" ' + treeStyle + '>' + spanStr + iconStr + '<span>' + v.replace(/\</g, '&lt;').replace(/\>/g, '&gt;') + '</span></div></td>';
htmlStr += '<td role="rowcell" ' + tdStyle + ' ><div class="u-grid-content-td-div" ' + treeStyle + '>' + spanStr + iconStr + '<span>' + v.replace(/\</g, '&lt;').replace(/\>/g, '&gt;') + '</span></div></td>';
});
return htmlStr;
};
Expand Down Expand Up @@ -2207,7 +2207,7 @@
htmlStr = '',
newCell = row.insertCell();
newCell.setAttribute("role", "rowcell");
newCell.title = v.replace(/\</g, '\<').replace(/\>/g, '\>');
// newCell.title = v.replace(/\</g,'\<').replace(/\>/g,'\>');
if (oThis.options.showTree && this.firstColumn) {
var l = parseInt(oThis.treeLeft) * parseInt(rowObj.level);
treeStyle = 'style="position:relative;';
Expand Down Expand Up @@ -3753,15 +3753,15 @@
v = u.dateTimeRender(v);
}
span.innerHTML = v;
td.title = v;
span.title = v;
} else if (dataType == 'Int') {
v = parseInt(v);
if (v) {
span.innerHTML = v;
td.title = v;
span.title = v;
} else {
span.innerHTML = "";
td.title = "";
span.title = "";
}
} else if (dataType == 'Float') {
if (precision) {
Expand All @@ -3774,17 +3774,17 @@
}
if (v) {
span.innerHTML = v;
td.title = v;
span.title = v;
} else {
span.innerHTML = "";
td.title = "";
span.title = "";
}
} else {
//此处逻辑放到渲染处,减少render执行次数。
v = oThis.getString(v, '');
var v1 = v.replace(/\</g, '\<');
v1 = v1.replace(/\>/g, '\>');
td.title = v;
span.title = v;
v = v.replace(/\</g, '&lt;');
v = v.replace(/\>/g, '&gt;');
span.innerHTML = v;
Expand All @@ -3793,7 +3793,7 @@
v = oThis.getString(v, '');
var v1 = v.replace(/\</g, '\<');
v1 = v1.replace(/\>/g, '\>');
td.title = v;
span.title = v;
v = v.replace(/\</g, '&lt;');
v = v.replace(/\>/g, '&gt;');
if (i == 0 && iconSpan) {
Expand Down
6 changes: 3 additions & 3 deletions dist/js/u-grid.min.js

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions js/gridCompCreate.js
Expand Up @@ -196,7 +196,7 @@ const createThead = function(createFlag) {
if(this.options.headerColor){
colorStype = 'style="color:' + this.options.headerColor + '"';
}
htmlStr += '<div class="u-grid-header-link" field="' + this.options.field + '" title="' + this.options.title + '" ' + colorStype + '>' + this.options.title + '</div>';
htmlStr += '<div class="u-grid-header-link" field="' + this.options.field + '" ' + colorStype + '>' + this.options.title + '</div>';
/*if(oThis.options.columnMenu && createFlag != 'fixed'){
// 创建右侧按钮图标
htmlStr += '<div class="u-grid-header-columnmenu uf uf-reorderoption " field="' + this.options.field + '" style="display:none;"></div>';
Expand All @@ -216,7 +216,7 @@ const createContent = function() {
var wh = $('#' + this.options.id)[0].offsetHeight;
this.wholeHeight = wh;
if (wh > 0) {
this.contentHeight = parseInt(wh) - this.exceptContentHeight > 0?parseInt(wh) - this.exceptContentHeight :0;
this.contentHeight = parseInt(wh) - this.exceptContentHeight - 1 > 0?parseInt(wh) - this.exceptContentHeight - 1 :0;
if(this.contentHeight > 0){
h = 'style="height:' + this.contentHeight + 'px;"';
}
Expand Down Expand Up @@ -527,7 +527,7 @@ const createContentOneRowTd = function(row,createFlag){
iconStr = '<span class="' + this.options.icon + '"></span>';
}
// title="' + v + '" 创建td的时候不在设置title,在renderType中设置,处理现实xml的情况
htmlStr += '<td role="rowcell" '+ tdStyle +' title="' + v.replace(/\</g,'\<').replace(/\>/g,'\>') + '"><div class="u-grid-content-td-div" ' + treeStyle+'>' + spanStr + iconStr + '<span>' + v.replace(/\</g,'&lt;').replace(/\>/g,'&gt;') + '</span></div></td>';
htmlStr += '<td role="rowcell" '+ tdStyle +' ><div class="u-grid-content-td-div" ' + treeStyle+'>' + spanStr + iconStr + '<span>' + v.replace(/\</g,'&lt;').replace(/\>/g,'&gt;') + '</span></div></td>';
});
return htmlStr;
};
Expand All @@ -549,7 +549,7 @@ const createContentOneRowTdForIE = function(row,rowObj,createFlag){
var renderType = this.options.renderType,treeStyle = '',spanStr ='',iconStr = '',
vStr= '',htmlStr = '',newCell= row.insertCell();
newCell.setAttribute("role","rowcell");
newCell.title = v.replace(/\</g,'\<').replace(/\>/g,'\>');
// newCell.title = v.replace(/\</g,'\<').replace(/\>/g,'\>');
if(oThis.options.showTree && this.firstColumn){
var l = parseInt(oThis.treeLeft)*parseInt(rowObj.level);
treeStyle = 'style="position:relative;';
Expand Down
14 changes: 7 additions & 7 deletions js/gridCompRenderType.js
Expand Up @@ -117,15 +117,15 @@ const renderTypeByColumn = function(gridCompColumn,i,begin,length, isFixedColumn
v = u.dateTimeRender(v);
}
span.innerHTML = v;
td.title = v;
span.title = v;
}else if(dataType == 'Int'){
v = parseInt(v);
if(v){
span.innerHTML = v;
td.title = v;
span.title = v;
}else{
span.innerHTML = "";
td.title = "";
span.title = "";
}
}else if(dataType == 'Float'){
if(precision){
Expand All @@ -138,16 +138,16 @@ const renderTypeByColumn = function(gridCompColumn,i,begin,length, isFixedColumn
}
if(v){
span.innerHTML = v;
td.title = v;
span.title = v;
}else{
span.innerHTML = "";
td.title = "";
span.title = "";
}
}else{ //此处逻辑放到渲染处,减少render执行次数。
v = oThis.getString(v,'');
var v1 = v.replace(/\</g,'\<');
v1 = v1.replace(/\>/g,'\>');
td.title = v;
span.title = v;
v = v.replace(/\</g,'&lt;');
v = v.replace(/\>/g,'&gt;');
span.innerHTML = v;
Expand All @@ -156,7 +156,7 @@ const renderTypeByColumn = function(gridCompColumn,i,begin,length, isFixedColumn
v = oThis.getString(v,'');
var v1 = v.replace(/\</g,'\<');
v1 = v1.replace(/\>/g,'\>');
td.title = v;
span.title = v;
v = v.replace(/\</g,'&lt;');
v = v.replace(/\>/g,'&gt;');
if (i == 0 && iconSpan) {
Expand Down

0 comments on commit fe1160a

Please sign in to comment.