easyui datagrid 显示 footer
1、设置 showFooter为true
$grid = $dg.datagrid({
// fit: true,
//fitColumns: true,
// pagination: false,
// pageSize: 20,
// pageList: [20, 40, 60, 80, 100],
showFooter:true,
scrollbarSize:0,
border: true,
striped: true,
singleSelect: false,
selectOnCheck: true,
checkOnSelect: true,
remoteSort:false,
rownumbers : false,//不显示序号
method:'get',
columns: [[{field: 'companyname', title: '经销商名称', width: parseInt($(this).width() * 0.2)},
{field: 'goodscount', title: '新增sku数', width: parseInt($(this).width() * 0.1),sortable:true,sorter:numberSort},
{field: 'upgoodscount', title: '在售sku数', width: parseInt($(this).width() * 0.1),sortable:true,sorter:numberSort},
{field: 'goodsSaleCount', title: '下单商品数', width: parseInt($(this).width() * 0.1),sortable:true,sorter:numberSort}
]],
onBeforeLoad: function (param) {
try {
let row = $(this).datagrid('getSelected');
let index = $(this).datagrid('getRowIndex', row);
row_key = index;
} catch (err) {
console.log(err);
}
},
onClickCell: function (index, field, value) {
$(this).datagrid('clearSelections');
},
onLoadSuccess: function (data) {
$(this).datagrid('checkRow', row_key);
},
toolbar: '#tb'
});
2、json数据,主要是footer 数组对象
{"total":9,"rows":[
{"id":1,"name":"Chai","price":18.00},
{"id":2,"name":"Chang","price":19.00},
{"id":3,"name":"Aniseed Syrup","price":10.00},
{"id":4,"name":"Chef Anton's Cajun Seasoning","price":22.00},
{"id":5,"name":"Chef Anton's Gumbo Mix","price":21.35},
{"id":6,"name":"Grandma's Boysenberry Spread","price":25.00},
{"id":7,"name":"Uncle Bob's Organic Dried Pears","price":30.00},
{"id":8,"name":"Northwoods Cranberry Sauce","price":40.00},
{"id":9,"name":"Mishi Kobe Niku","price":97.00}
],"footer":[
{"name":"Total","price":282.35},
{"name":"Average","price":31.37}
]}
easyui datagrid 显示 footer的更多相关文章
- EasyUI DataGrid 添加 Footer
做后台管理界面时,EasyUI 的 DataGrid 经常会被用到,有时候一些总的统计数据不合适放在数据表格里,需要单独显示,这时候就可以放在Footer中显示而不必另外布局. 该怎么给 DataGr ...
- easyui datagrid显示进度条控制操作
在当我们需要控制时间前台实际项目页面datagrid显示进度条的数据加载时运行,和datagrid默认情况下只在有url加载运行时的数据显示方式的进度条.下面的代码手动控制: 打开一个进度条: $(' ...
- Easyui datagrid 显示隐藏列
html: <div style="float: left; width: 1450px; height:auto; "> & ...
- easyUi DataGrid 显示日期列,时间为空也可,的正常显示,及普通居中列情况
$('#tt').datagrid({ url: '@Url.Content("~/kpi/FindList")', w ...
- EasyUi Datagrid中footer renderFooter
默认的'rowStyler' 选项不支持footer,想让footer支持rowStyler的话,dategird就得重写.代码如下. var myview = $.extend({}, $.fn.d ...
- easyui datagrid 没数据时显示滚动条的解决方法
今天解决了一个bug,因为datagrid有多列,可是当没有数据的时候,后面的列无法通过滚动条拉动来显示,比较麻烦,而需求要求没有数据也要拉动滚动条查看后面有什么列,一开始在网上找了一些资料,发现都不 ...
- easyui datagrid中datetime字段的显示和增删改查问题
datagrid中datetime字段的异常显示: 使用过easyui datagrid的应该都知道,如果数据库中的字段是datetime类型,绑定在datagrid显式的时候会不正常显示,一般需要借 ...
- 实现easyui datagrid在没有数据时显示相关提示内容
本示例实现easyui datagrid加载/查询数据时,如果没有相关记录,则在datagrid中显示没有相关记录的提示信息,效果如下图所示 本实例要实现如下图所示的效果: 本示例easyui版本为1 ...
- easyui datagrid 列隐藏和显示
easyui datagrid 列隐藏和显示 用js怎么控制列的显示和隐藏? 最佳答案 $('#grid').datagrid('hideColumn','列field');把hideColu ...
随机推荐
- P3596 [POI2015]MOD
$ \color{#0066ff}{ 题目描述 }$ 给定一棵无根树,边权都是1,请去掉一条边并加上一条新边,定义直径为最远的两个点的距离,请输出所有可能的新树的直径的最小值和最大值 \(\color ...
- 百度编辑器 Ueditor使用记录
Ueditor官网: http://fex.baidu.com/ueditor/#dev-bale_width_grunt UeditorAPI文档: https://ueditor.baidu.co ...
- TX2 自制底板不识别USB
目的:解决自制的底板无法识别USB,使能3个UART接口,使能3个SPI接口. Jetpack版本:Jetpack-3.1 虚拟机:ubuntu14.04 使用dtb文件夹下的文件替换刷机包../64 ...
- chmod变更文件或目录的权限
chmod命令用来变更文件或目录的权限.在UNIX系统家族里,文件或目录权限的控制分别以读取.写入.执行3种一般权限来区分,另有3种特殊权限可供运用.用户可以使用chmod指令去变更文件与目录的权限, ...
- SQL语句之行操作
SQL语句系列 1.SQL语句之行操作 2.SQL语句之表操作 3.SQL语句之数据库操作 4.SQL语句之用户管理 关系型数据库的存储形式 在关系型数据库中,数据都是以类似于Excel表格的形式存储 ...
- mysql id_logfile 日志
ib_logfile 文件原理 ib_logfile0 是innodb中事务日志,记录系统的回滚,重做日志,记录的是文件的物理更改,存放位置my.ini 中的 datadir="D:\php ...
- Docker Run 设置环境变量
Docker Run We can then override the environment variables set in the Docker file when running the im ...
- Docker镜像的导出和载入
https://www.cnblogs.com/lishidefengchen/p/10564765.html
- Oracle中对XMLType的简单操作(extract、extractvalue)
前几天一直在做Oracle对XMLType字段的操作,我还不是Oracle大拿,到网上找了很多资料,但是很多就是单一功能的介绍,不能很好的解决问题,现在在这里总结下. 1.下面先创建一个名未test. ...
- javascript的Astar版 寻路算法
去年做一个模仿保卫萝卜的塔防游戏的时候,自己写的,游戏框架用的是coco2d-html5 实现原理可以参考 http://www.cnblogs.com/technology/archive/2011 ...