老莫的笔记本  
  
查看: 1114|回复: 0

阻止表格全选的方法

[复制链接]

662

主题

878

帖子

5141

积分

超级版主

Rank: 8Rank: 8

积分
5141
发表于 2018-11-8 11:29:38 | 显示全部楼层 |阅读模式
网上有一种乱七八糟的 处理方法, 我个人觉得没必要, 胖爷我把 表格左上角的 全选 checkbox 遮住不就好了, 具体的就是在table 渲染的 down里 加个方法,这方法的目的是加个span 遮住 select
  1. // 左侧搜索表格初始化
  2.       table.render({
  3.         elem: '#lm-left-table'
  4.         , url: '/dtype'
  5.         , cols: [[
  6.           { type: 'checkbox' }
  7.           , { field: 'mtype', width: 100, title: '类似群', sort: true }
  8.           , { field: 'ctype', width: 80, title: '类别', sort: true }
  9.           , { field: 'xtype', width: 120, title: '商品编号', sort: true }
  10.           , { field: 'spfw', title: '商品名称' }
  11.           , { field: 'datatype', width: 110, title: '商品类型' }
  12.         ]]
  13.         , page: true
  14.         , limit: 20
  15.         , done:function(){
  16.                 $('th div.laytable-cell-checkbox').css('position','relative')
  17.                 $('th div.laytable-cell-checkbox').append('<span id="lm-msk"></span>')
  18.                 $('#lm-msk').css({
  19.                     'width':'100%'
  20.                     ,'height':'100%'
  21.                     ,'position':'absolute'
  22.                     ,'top':'0'
  23.                     ,'left':'0'
  24.                     ,'z-index':'999'
  25.                     ,'background-color':'#f2f2f2'
  26.                 })
  27.           }
  28.       });
复制代码
怕自己忘了, 提醒我自己一下  不用加css样式 直接这个 done 复制粘贴过来
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

快速回复 返回顶部 返回列表