<div class="box1">
<div class="dg1Box" style="margin-top:15px; margin-left:25px;">
<table id="dg1" style="width:575px;"></table>
</div>
</div> <div class="box2" style="display:none;">
<div class="dg2Box" style="margin-top:15px; margin-left:25px;">
<table id="dg2" style="width:575px;"></table>
</div>
</div>

这样布局tab之后在JS中绑定datagrid:

    $('#dg1').datagrid({
columns: [[
{ field: 'CompoundName', title: '组分名', width: 130, align: 'center', resizable:false },
{ field: 'CompoundMofo', title: '分子式', width: 130, align: 'center', resizable: false },
{ field: 'CompoundGraph', title: 'CAS号', width: 130, align: 'center', resizable: false },
{ field: 'operate', title: '操作', width: 130, align: 'center', resizable: false }
]],
rownumbers: true
}); $('#dg2').datagrid({
columns: [[
{ field: 'TBCompoundID', title: '组分库Id', width: 130, align: 'center', resizable: false },
{ field: 'HeaderText', title: '表头', width: 130, align: 'center', resizable: false },
{ field: 'Format', title: '格式', width: 130, align: 'center', resizable: false },
{ field: 'operate', title: '操作', width: 130, align: 'center', resizable: false }
]],
rownumbers: true
});

切换到第二个表格的时候,表头不显示,可能是display为none的时候datagrid也会被隐藏

只要在显示当前div的时候,执行这条代码$("#dg2").datagrid("resize");  就可以啦。

easyUI-datagrid属性设置display:none,表头不显示的更多相关文章

  1. Easyui Datagrid rownumbers行号四位、五位显示不完全的解决办法

    Easyui Datagrid rownumbers行号四位.五位显示不完全的解决办法(引) 方法一: 相信很多人在使用easyui的时候都遇到过这个问题,当我们设置成显示Rownumber的时候,你 ...

  2. easyui datagrid里的toobar按钮隐藏、显示、禁用等方式的实现

    easyui datagrid里的toobar按钮隐藏.显示.禁用等方式的实现 //隐藏第一个按钮 $('div.datagrid-toolbar a').eq(0).hide(); //隐藏第一条分 ...

  3. [转]浅谈jQuery EasyUI的属性设置

    原文地址:http://www.easyui.info/archives/1664.html 对jQuery EasyUI有一定了解的话,应该知道基本上每一个组件都有一个"options&q ...

  4. easyui datagrid属性和方法

    本文可以当做api来使用 使用方法(Usage Example) 从现有的表单元素创建数据表格,定义在html中的行,列和数据. <table class="easyui-datagr ...

  5. easyui datagrid动态设置行、列、单元格不允许编辑

    Easyui datagrid 行编辑.列编辑.单元格编辑设置 功能: 动态对datagrid 进行行.列.单元格编辑进行设置不允许编辑. 禁用行编辑: 在编辑方法调用前,对选择的行进行判断,如果不允 ...

  6. easyui datagrid pagesize设置无效

  7. easyui datagrid JS加载样式 表头乱

    解决方案,找了下资料,加一个遮罩层,提升用户体验. <script type="text/javascript"> var width = document.docum ...

  8. 【技巧】easyUI datagrid在隐藏时加载,显示时无法加载出界面

    注意在显示时调用再调用一次resize就可以显示出来 $("#"+datagridId).datagrid("resize");

  9. 重新=》easyui DataGrid是否可以动态的改变列显示的顺序

    $.extend($.fn.datagrid.methods,{ columnMoving: function(jq){ return jq.each(function(){ var target = ...

随机推荐

  1. 【202】ThinkPad手势&快捷键

    快捷键: Ctrl + Alt + ↑:正常屏幕Ctrl + Alt + ↓:翻转屏幕Ctrl + Alt + →:向左侧翻转90°Ctrl + Alt + ←:向右侧翻转90° 首先看下 Esc 键 ...

  2. iOS Button选中与取消

    /** * 是否点击 */ @property (nonatomic ,assign) BOOL selected; /** *  button 点击事件选中取消选中 */ - (void)handl ...

  3. Codeforces626C 【二分】

    题意: 有两种搬砖的(不好好打代码就只能搬砖了),有n个sou弱的只能搬2块,m个stronger一点的能搬3块,他们想作死的独自把砖垒高,然后每个人垒的高度还各不相同,问你存在的最高高度的最小: 思 ...

  4. hihoCoder 1032

    最长回文子串的O(1)算法Manacher算法 #include <iostream> #include <stdio.h> #include <string.h> ...

  5. pycharm 整段缩进

    转自 https://blog.csdn.net/zoulonglong/article/details/79869787 在使用pycharm时,经常会需要多行代码同时缩进.左移,pycharm提供 ...

  6. EditPlus 3:设置自动换行

    打开软件,菜单栏点击Document,再在下拉栏中点击Permanent Settings,然后在弹出的设置框中找到Word Wrap点击,最后在弹出的小框中勾选第一个Enable word wrap ...

  7. 为什么wait,notify和notifyAll要与synchronized一起使用?

    https://blog.csdn.net/qq_39907763/article/details/79301813 Object.wait(),Object.notify(),Object.noti ...

  8. AtCoder Regular Contest 081 F - Flip and Rectangles

    题目传送门:https://arc081.contest.atcoder.jp/tasks/arc081_d 题目大意: 给定一个\(n×m\)的棋盘,棋盘上有一些黑点和白点,每次你可以选择一行或一列 ...

  9. ACM_LRU页面置换算法

    LRU页面置换算法 Time Limit: 2000/1000ms (Java/Others) Problem Description: sss操作系统没听课, 这周的操作系统作业完全不会, 你能帮他 ...

  10. Git命令---递归克隆

    git clone --recursive https://github.com/rbgirshick/fast-rcnn.git Git命令 --recursive 会递归克隆fast-rcnn项目 ...