HandsonTable隐藏某例

zhaozanzan 2015-02-04 10:10:35

如图隐藏客户类别这一列
...全文
561 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
闲云9134 2016-09-20
  • 打赏
  • 举报
回复
<button id="hideCell" data_value="0">
影藏
</button>
<div id="example"></div>

$('#hideCell').on('click',function(e){
var val=this.getAttribute("data_value")
var flag=true;
var cell=1;//影藏的哪列
if(val=='0'){
this.setAttribute("data_value",'1');
flag=false;
}else{
this.setAttribute("data_value",'0');
flag=true;
}
hideCell1(cell,flag);
});

function hideCell1(cellIndex, isHide){
$('#example').find('tr').each(function(){
$(this).find('>th').eq(cellIndex).toggle(!isHide);
$(this).find('>td').eq(cellIndex).toggle(!isHide);
});

}

就在官网上面事例里面写的,你可以根据这个修改下应该可以的


波儸密 2015-02-04
  • 打赏
  • 举报
回复
没上代码 怎么帮呢

87,903

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 JavaScript
社区管理员
  • JavaScript
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧