提交 b2752ede 编写于 作者: NoSubject's avatar NoSubject

修复数据网格中多行文本换行显示问题

上级 e8c34932
......@@ -157,6 +157,12 @@ MWF.xApplication.process.Xform.DatagridMobile = new Class({
return value;
}
break;
case "Textarea":
var reg = new RegExp("\n","g");
var reg2 = new RegExp("\u003c","g"); //尖括号转义,否则内容会截断
var reg3 = new RegExp("\u003e","g");
value = value.replace(reg2,"&lt").replace(reg3,"&gt").replace(reg,"<br/>");
break;
}
}
return value;
......@@ -212,10 +218,15 @@ MWF.xApplication.process.Xform.DatagridMobile = new Class({
var module = this.editModules[index];
if( module && module.json.type == "ImageClipper" ){
this._createImage( cell, module, v )
this._createImage( cell, module, v );
}else{
text = this._getValueText(index, v);
cell.set("text", text);
if( module && module.json.type == "Textarea" ){
cell.set("html", text);
}else{
cell.set("text", text);
}
//cell.set("text", text);
}
......@@ -297,7 +308,12 @@ MWF.xApplication.process.Xform.DatagridMobile = new Class({
this._createImage( cell, module, v )
}else{
text = this._getValueText(index, v);
cell.set("text", text);
if( module && module.json.type == "Textarea" ){
cell.set("html", text);
}else{
cell.set("text", text);
}
//cell.set("text", text);
}
// if (typeOf(v)==="object"){
......@@ -682,7 +698,14 @@ MWF.xApplication.process.Xform.DatagridMobile = new Class({
if( module.json.type == "ImageClipper" ){
this._createImage( cell, module, data.text );
}else{
cell.set("text", data.text.join(", "));
var text = this._getValueText(idx, data.text.join(", "));
if( module.json.type == "Textarea"){
cell.set("html", text);
}else{
cell.set("text", data.text.join(", "));
}
//cell.set("text", data.text.join(", "));
}
}else{
dataRow = table.insertRow(idx);
......@@ -1466,4 +1489,4 @@ MWF.xApplication.process.Xform.DatagridMobile$Data = new Class({
}.bind(this));
}
}
});
\ No newline at end of file
});
......@@ -194,6 +194,12 @@ MWF.xApplication.process.Xform.DatagridPC = new Class({
return value;
}
break;
case "Textarea":
var reg = new RegExp("\n","g");
var reg2 = new RegExp("\u003c","g"); //尖括号转义,否则内容会截断
var reg3 = new RegExp("\u003e","g");
value = value.replace(reg2,"&lt").replace(reg3,"&gt").replace(reg,"<br/>");
break;
// case "address":
// if (typeOf(value)==="array"){
......@@ -221,7 +227,12 @@ MWF.xApplication.process.Xform.DatagridPC = new Class({
if( module && module.json.type == "ImageClipper" ){
this._createImage( cell, module, text )
}else{
cell.set("text", text);
if( module && module.json.type == "Textarea" ){
cell.set("html", text);
}else{
cell.set("text", text);
}
// /cell.set("text", text);
}
cell.addEvent("click", function(e){
this._editLine(e.target);
......@@ -460,7 +471,12 @@ MWF.xApplication.process.Xform.DatagridPC = new Class({
if( module.json.type == "ImageClipper" ){
this._createImage( cell, module, data.text );
}else{
cell.set("text", data.text.join(", "));
var text = this._getValueText(idx-1, data.text.join(", "));
if( module.json.type == "Textarea"){
cell.set("html", text);
}else{
cell.set("text", data.text.join(", "));
}
}
}else{
this._createNewEditTd(newTr, idx, editorTds[idx].get("id"), data.text.join(", "), titleThs.length-1);
......@@ -723,10 +739,14 @@ MWF.xApplication.process.Xform.DatagridPC = new Class({
var module = this.editModules[index];
if( module && module.json.type == "ImageClipper" ){
this._createImage( cell, module, v )
this._createImage( cell, module, v );
}else{
var text = this._getValueText(index, v);
cell.set("text", text);
if( module && module.json.type == "Textarea" ){
cell.set("html", text);
}else{
cell.set("text", text);
}
}
......@@ -1252,4 +1272,4 @@ MWF.xApplication.process.Xform.DatagridPC$Data = new Class({
}.bind(this));
}
}
});
\ No newline at end of file
});
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册