nowrap : true;  是前提

$('#×××').datagrid({
    nowrap : true,//设置为true,当数据长度超出列宽时将会自动截取        
});

 

省略号样式:


<style type="text/css"> .datagrid-cell, .datagrid-cell-group, .datagrid-header-rownumber, .datagrid-cell-rownumber { text-overflow: ellipsis; } </style>

鼠标移动到单元格显示文本

<th data-options="field:'×××',width:70,align:'center',formatter:show1">×××</th>

代码1:

function show1(val,row){
    if (val){
        return '<span style="font-size:15px" title="' + val + '">' + val + '</span>';
    } else {
        return val;
    }
}

代码2:

function show2(value, row, index){
    var content = '';
    if(value != undefined && value != '' && value != null ){ 
        var abValue = value +'';
        content = '<a style="font-size:15px" href="javascript:void(0);"  title="' + abValue + '" class="easyui-tooltip">' + abValue + '</a>'; 
    }   
    return content;
}
posted on 2018-10-30 17:30  月零Ray  阅读(450)  评论(0编辑  收藏  举报