zoukankan      html  css  js  c++  java
  • layui table表格字段过长,展示不完整时,鼠标放到上面展示完整信息

    1、首先每个列都有一个title,里面放入完整信息,然后写一个如下的function,

    1
    2
    3
    4
    5
    6
    7
    8
    function tdTitle(){
        $('th').each(function(index,element){
            $(element).attr('title',$(element).text());
        });
        $('td').each(function(index,element){
            $(element).attr('title',$(element).text());
        });
    };

      2、在table数据渲染完的回调done中调用刚才写的function

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    table.render({
      cols:  [[ //标题栏
        {checkbox: true}
        ,{field: 'id', title: 'ID', 80}
        ,{field: 'username', title: '用户名', 120}
      ]]
      ,done:function(res){
            tdTitle();
        }
    });
  • 相关阅读:
    SpringBoot整合阿里云OSS
    UVALive
    HDU 5794 A Simple Chess dp+Lucas
    数论
    UVALive
    UVALive
    HDU 5792 World is Exploding 树状数组+枚举
    UVALive
    UVALive
    UVALive
  • 原文地址:https://www.cnblogs.com/uzxin/p/12090342.html
Copyright © 2011-2022 走看看