- jqgrid中加入formatter
{index:‘authenticationFunction‘,name:‘authenticationFunction‘,align:"center",title:false,formatter:StrLenFormat},
2.引入包
<script type="text/javascript" src=\‘#\‘" %>/quality/js/strgride.js"></script>
3.js文件如下
function StrLenFormat(cellvalue, options, rowObject){
var oldstrlen=cellvalue.length;
var newstr="";
if(oldstrlen>10){
newstr=cellvalue.substring(0,10)+"...";
newstr="<div title=‘"+cellvalue+"‘>"+newstr+"</div>";
}else{
newstr=cellvalue;
}
return newstr;
}
时间: 2024-10-22 15:57:27