EasyUI - DataGrid 去右边空白滚动条列
在网上查了很长时间没有找到解决方法,干脆自已查看一下代码来解决吧,随是压缩过的,不过也还是好查的,工夫不负有心人,终于解决了,方法如下:
一、我们先让表格自适应宽度
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Basic DataGrid - jQuery EasyUI Demo</title>
<link rel="stylesheet" type="text/css" href="../../themes/bootstrap/easyui.css">
<link rel="stylesheet" type="text/css" href="../../themes/icon.css">
<link rel="stylesheet" type="text/css" href="../demo.css">
<script type="text/javascript" src="../../jquery.min.js"></script>
<script type="text/javascript" src="../../jquery.easyui.min.js"></script>
</head>
<body>
<h2>Basic DataGrid</h2>
<div class="demo-info">
<div class="demo-tip icon-tip"></div>
<div>The DataGrid is created from markup, no JavaScript code needed.</div>
</div>
<div style="margin:10px 0;"></div> <table class="easyui-datagrid"
data-options="singleSelect:true,collapsible:true,url:'datagrid_data1.json',method:'get',fitColumns:'true'">
<thead>
<tr>
<th data-options="field:'itemid',width:300">Item ID</th>
<th data-options="field:'productid',width:300">Product</th>
<th data-options="field:'listprice',width:300,align:'right'">List Price</th>
<th data-options="field:'unitcost',width:300,align:'right'">Unit Cost</th>
<th data-options="field:'attr1',width:300">Attribute</th>
<th data-options="field:'status',width:300,align:'center'">Status</th>
</tr>
</thead>
</table>
<script>
$(window).resize(function () {
$('#tt').datagrid('resize');
});
</script>
</body>
</html>
二、修改jquery.easyui.min.js这个文件来解决滚动条问题
function _4bf(_4c0){
var opts=$.data(_4c0,"datagrid").options;
var dc=$.data(_4c0,"datagrid").dc;
var wrap=$.data(_4c0,"datagrid").panel;
var _4c1=wrap.width()+20;
var _4c2=wrap.height();
var view=dc.view;
var _4c3=dc.view1;
var _4c4=dc.view2;
var _4c5=_4c3.children("div.datagrid-header");
var _4c6=_4c4.children("div.datagrid-header");
var _4c7=_4c5.find("table");
var _4c8=_4c6.find("table");
view.width(_4c1);
var _4c9=_4c5.children("div.datagrid-header-inner").show();
_4c3.width(_4c9.find("table").width());
if(!opts.showHeader){
_4c9.hide();
}
可以看到我在 7001 行处加上了一个+20,这样让宽度正好覆盖滚动条
大家如果有更好的方法留言给我呀
EasyUI - DataGrid 去右边空白滚动条列的更多相关文章
- EasyUI - DataGrid 去右边空白滚动条列 分类: JavaScript 2014-09-03 10:46 1090人阅读 评论(2) 收藏
熟悉 EasyUI - DataGrid 的童鞋应该会注意到这样一个情景: 想去掉这块,找了下资料,发现也有人同样纠结:http://www.cnblogs.com/hantianwei/p/3440 ...
- (轉)EasyUI - DataGrid 去右边空白滚动条列
熟悉 EasyUI - DataGrid 的童鞋应该会注意到这样一个情景: 想去掉这块,找了下资料,发现也有人同样纠结:http://www.cnblogs.com/hantianwei/p/3440 ...
- 初识 easyui datagrid
首先应该下载好easyui datagrid所用的各种js 和css 这个可以到官网上去下载. 首先要引入datagrid所引入的js和css. <script src="js/jqu ...
- 构建ASP.NET MVC4+EF5+EasyUI+Unity2.x注入的后台管理系统(8)-MVC与EasyUI DataGrid 分页
系列目录 前言 为了符合后面更新后的重构系统,文章于2016-11-1日重写 EasyUI Datagrid在加载的时候会提交一些分页的信息到后台,我们需要根据这些信息来进行数据分页再次返回到前台 实 ...
- jQuery EasyUI DataGrid Checkbox 数据设定与取值
纯粹做个记录,以免日后忘记该怎么设定. 这一篇将会说明两种使用 jQuery EasyUI DataGrid 的 Checkbox 设定方式,以及在既有数据下将 checked 为 true 的该笔数 ...
- easyui datagrid的列编辑
[第十五篇]easyui datagrid的列编辑,同时插入两张表的数据进去 看图说话. 需求:插入两张表,上面的表单是第一张表的内容,下面的两个表格是第二张详情表的内容,跟第一张表的id关联 第 ...
- (转)扩展jquery easyui datagrid 之动态绑定列和数据
本文转载自:http://blog.csdn.net/littlewolf766/article/details/7336550 easyui datagrid 不支持动态加载列,上次使用的方法是自己 ...
- EasyUI datagrid checkbox数据设定与取值(转自http://blog.csdn.net/baronyang/article/dnetails/9323463,感谢分享,谢谢)
这一篇将会说明两种使用 jQuery EasyUI DataGrid 的 Checkbox 设定方式,以及在既有数据下将 checked 为 true 的该笔数据列的 Checkbox 设定为 Che ...
- EasyUI DataGrid分页数据绑定
记录东西感觉很痛苦,总结东西很痛苦,麻烦,不过为了下次的方便和知识的牢固以后要坚持总结. EasyUI DataGrid分页数据绑定 在解决方案中新建两个文件FormMain.aspx(html也可以 ...
随机推荐
- 020 $.each的使用
在工作中见到这个知识点,不是特别懂,就查了查资料,顺便整理一下 1.定义与用法 each() 方法规定为每个匹配元素规定运行的函数. 提示:返回 false 可用于及早停止循环. 语法 $(selec ...
- 019 spark on yarn(Job的运行流程,可以对比mapreduce的yarn运行)
1.大纲 spark应用构成:Driver(资源申请.job调度) + Executors(Task具体执行) Yarn上应用运行构成:ApplicationMaster(资源申请.job调度) + ...
- C#自动生成XML文件
命名空间:using System.Xml; 程序集: System.Xml(在 System.Xml.dll 中). 涉及到的类和方法: XmlDeclaration 类:表示 XML 声明节点: ...
- curl 文件上传
curl_file_create (带路径的文件名 [, 文件mimetype , 上传数据里的文件名] ) ; new cURLFile (带路径的文件名 [, 文件mimetype , 上传数据里 ...
- 【Java】同步阻塞式(BIO)TCP通信
TCP BIO 背景 网络编程的基本模型是Clien/Server模型,也就是两个进程之间进行相互通信,其中服务端提供位置信息(绑定的IP地址和监听端口),客户端通过连接操作向服务端监听的地址发起连接 ...
- Alpha冲刺随笔五:第五天
课程名称:软件工程1916|W(福州大学) 作业要求:项目Alpha冲刺(十天冲刺) 团队名称:葫芦娃队 作业目标:在十天冲刺里对每天的任务进行总结. 随笔汇总:https://www.cnblogs ...
- ruby那些事儿
为了学习sass,客串一下ruby,这是一个破案的过程,探索的过程. Ruby是日本人发明的一种类似于Python和Perl的服务器端脚本语言,它完全面向对象,适合于快速开发,一般开发效率是java的 ...
- 潭州课堂25班:Ph201805201 WEB 之 JS 第六课 (课堂笔记)
上节补充方法 <!DOCTYPE html> <html lang="en"> <head> <meta charset="UT ...
- 最小生成树之克鲁斯卡尔(kruskal)算法
#include <iostream> #include <string> using namespace std; typedef struct MGraph{ string ...
- 在Notepad++中快捷选中多行
原文: 在Notepad++中快捷选中多行 Notepad++是Windows下一款很好用的文本编辑器. 如果需要在一个文档中选中指定的若干行,常见的办法是鼠标按住拖动.这样对于少数几行的选取还可以, ...