您的位置:首页 > 产品设计 > UI/UE

EasyUI Datagrid 鼠标悬停显示单元格内容

2017-10-31 16:16 751 查看
第一种方式:
1.js 定义函数
<script type="text/javascript">
//格式化单元格提示信息
function formatCellTooltip(value){
return "<span title='" + value + "'>" + value + "</span>";
}
</script>

2、调用函数
 <table class="easyui-datagrid" style="width:400px;height:250px"
    data-options="url:'datagrid_data.json',fitColumns:true,singleSelect:true">
    <thead>
      <tr>
      <th data-options="field:'itemid',width:80,halign:'center',formatter:formatCellTooltip">Item ID</th>
      </tr>
    </thead>
 </table>
源码:jquery-easyui-1.3.6.zip    例子是:jquery-easyui-1.3.6\demo\datagrid\formatter.html
 第二种方式:1.html<table id="dg"></table>2.js$('#dg').datagrid({fitColumns: true,nowrap: true,striped: true,rownumbers: true,pagination: true,singleSelect: true,columns: [[{ field: "itemid", title: 'Item ID', width:80,halign:'center', formatter: function (value) {return "<span title='" + value + "'>" + value + "</span>";}}]]});源码:jquery-easyui-1.3.6.zip 例子是:jquery-easyui-1.3.6\demo\datagrid\formatter2.html
http://www.cnblogs.com/xuguanghui/p/4976636.html
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: