首页 > Web开发 > 详细

mvc index 用table显示内容,文字过长时用......表示

时间:2015-07-17 11:28:10      阅读:282      评论:0      收藏:0      [点我收藏+]

 

此行是显示文字的内容,加载时自动调用commonSubstring()函数判断

{
title: ‘点评‘, field: ‘commonent‘, width: 180, resizable: true,
formatter: function (val, row)
{
var strcommon = "";
strcommon += "<font>" + commonSubstring(row.commonent) + "</font>";
return strcommon;
}
},

 

function commonSubstring(str) {
if (str != null) {
if (str.length > 20) {
var sub = str.substring(0, 20) + "......";
return sub;
} else {
return str;
}
}
if (str == null) {
return "";
}
}

 

mvc index 用table显示内容,文字过长时用......表示

原文:http://www.cnblogs.com/zxk3113/p/4653606.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!