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

向右看齐 2024-04-18 11:37 125阅读 0赞
  1. 第一种方式:
  2. 1.js 定义函数
  3. <script type="text/javascript"> //格式化单元格提示信息 function formatCellTooltip(value){ return "<span title='" + value + "'>" + value + "</span>"; } </script>
  4. 2、调用函数
  5. <table class="easyui-datagrid" style="width:400px;height:250px" data-options="url:'datagrid_data.json',fitColumns:true,singleSelect:true">
  6. <thead>
  7.   <tr>
  8.       <th data-options="field:'itemid',width:80,halign:'center',formatter:formatCellTooltip">Item ID</th>
  9.   </tr>
  10. </thead>
  11. </table>
  12. 源码:jquery-easyui-1.3.6.zip 例子是:jquery-easyui-1.3.6\demo\datagrid\formatter.html
  13. 第二种方式:
  14. 1.html
  15. <table id="dg">
  16. </table>
  17. 2.js
  18. $('#dg').datagrid({
  19. fitColumns: true,
  20. nowrap: true,
  21. striped: true,
  22. rownumbers: true,
  23. pagination: true,
  24. singleSelect: true,
  25. columns: [[
  26. { field: "itemid", title: 'Item ID', width:80,halign:'center', formatter: function (value) {
  27. return "<span title='" + value + "'>" + value + "</span>";
  28. }
  29. }]]
  30. });
  31. 源码:jquery-easyui-1.3.6.zip 例子是:jquery-easyui-1.3.6\demo\datagrid\formatter2.html

发表评论

表情:
评论列表 (有 0 条评论,125人围观)

还没有评论,来说两句吧...

相关阅读

    相关 easyui-datagrid 编辑单元

    在做itoo成绩的时候,有个需求是教师判分,学生成绩有两部分组成:平时成绩和期末成绩,然后根据两种成绩比例算出总成绩。现在是有了平时成绩和成绩比例,输入期末成绩,计算出总成绩,