【easyui】关于easyui Datagrid一些样式记录
此篇文章主要记录在使用datagrid中常见的修改样式方式以及样式效果配图!!!!
一丶存在选中框的时候标题栏合并显示序号字段。
代码展示:
onLoadSuccess: function (data) {
//调整 按钮div与datagrid之间的3px间距
$('#j_contentButton').css('height', '43px');
//修改全选按钮
$(".datagrid-header-check").html("序号");
$(".datagrid-header-check").parent().prev().html("");
$(".datagrid-header-check").attr("style", "width:79px !important;font-weight: 700;height: 40px; line-height: 40px;font-size: 15px;")
},
效果图展示:
二丶不存在选中框的时候标题栏合并显示序号字段。
代码展示:
onLoadSuccess: function (data) {
//修改全选按钮
$(".datagrid-header-rownumber").html("序号");
$(".datagrid-header-rownumber").parent().next().html("");
},
效果图展示:
三丶左右布局时去除间隔空隙注意第5行 他才是关键其余只是为了展示效果
代码展示:
j_dgReceive = $("#j_dgReceive").datagrid({
iconCls: 'icon-save',
fit: true, // 自动适应父容器大小
fitColumns: false, //自动收缩列的大小
scrollbarSize: ,
rownumbers: true, //显示列号
nowrap: true, //如果为true,则在同一行中显示数据
animate: false,
border: false, //有边框
singleSelect: true,//多选
idField: 'id', //标识字段
pagination: true,//数据表格控件底部显示分页工具栏
pageSize: ,
pageList: [, , , , , , , ],
url: '/FeeManage_Areas/FeeStatistics/GetBJbyCondition',
queryParams: {
childId: childId,
},
效果图展示:
四丶实现单元格可编辑效果
代码展示:
{
title: '退费金额', field: 'refundMoney', align: 'center', width: , sortable: true,
editor: {
type: 'validatebox',
options: {
validType: 'checkDecN',
onBeforeValidate: function () {
$(this).attr('maxlength', );
$(this).on("keyup", function (event) {
var ary = this.value.match(/(\d+(\.\d{,})?)/);
this.value = ary == null ? '' : ary[];
});
} }
},
},
效果图展示:
五丶合并单元格跨行款列标题布局
代码展示:
//活动列
columns: [[
{ title: '园区名称', field: 'parkName', rowspan: , align: 'center', width: , sortable: true, },
{ title: '姓名', field: 'childName', rowspan: , align: 'center', width: , sortable: true },
{ title: '年级', field: 'gradeNo', rowspan: , align: 'center', width: , sortable: true, },
{ title: '班级', field: 'classNo', rowspan: , align: 'center', width: , sortable: true, },
{ title: '保教费', colspan: , align: 'center', },
{ title: '学平险', colspan: , align: 'center', },
{ title: '餐费', colspan: , align: 'center', },
{ title: '休园管理费', colspan: , align: 'center', },
{ title: '押金', colspan: , align: 'center', },
{ title: '自定义费用', colspan: , align: 'center', },
{ title: '幼儿缴费总额', field: 'childTotalReceive', rowspan: , align: 'center', width: , sortable: true, },
{ title: '幼儿退费总额', field: 'childTotalRefund', rowspan: , align: 'center', width: , sortable: true, },
], [
//保教费
{ title: '缴费总额', field: 'bjfTotalReceive', align: 'center', width: , sortable: true, },
{ title: '退费总额', field: 'bjfTotalRefund', align: 'center', width: , sortable: true, },
//学平险
{ title: '缴费总额', field: 'xpxTotalReceive', align: 'center', width: , sortable: true, },
{ title: '退费总额', field: 'xpxTotalRefund', align: 'center', width: , sortable: true, },
//餐费
{ title: '缴费总额', field: 'cfTotalReceive', align: 'center', width: , sortable: true, },
{ title: '退费总额', field: 'cfTotalRefund', align: 'center', width: , sortable: true, },
//休园管理费
{ title: '缴费总额', field: 'xyglfTotalReceive', align: 'center', width: , sortable: true, },
{ title: '退费总额', field: 'xyglfTotalRefund', align: 'center', width: , sortable: true, },
//押金
{ title: '缴费总额', field: 'yjTotalReceive', align: 'center', width: , sortable: true, },
{ title: '退费总额', field: 'yjTotalRefund', align: 'center', width: , sortable: true, },
//自定义
{ title: '缴费总额', field: 'zdyTotalReceive', align: 'center', width: , sortable: true, },
{ title: '退费总额', field: 'zdyTotalRefund', align: 'center', width: , sortable: true, }, ]],
效果图展示:
六丶修改选中框样式
代码展示:
//冻结列
frozenColumns: [[
{
title: '', field: 'printFlag', align: 'center', sortable: true, width: ,
formatter: function (value, row, index) {
if (value == ) {
return "<span class='item-selected' onclick='specificUtil.CheckOrUnCheck(" + index + ",\"" + row.id + "\")'></span>";
} else {
return "<span class='item-unselected' onclick='specificUtil.CheckOrUnCheck(" + index + ",\"" + row.id + "\")'></span>";
}
},
},
{ title: '主键', field: 'id', sortable: true, align: 'center', width: , hidden: true, },
]], //3.选中或取消选中
CheckOrUnCheck: function (index, rowId) {
var rows = $("#j_dgExamine").datagrid("getRows");
if (initClick != undefined) {
var row = rows[index];
//提交数据
$.ajax({
type: 'POST',
url: '/Welfare_Areas/WelfareExamine/AccMark',
data: {
accId: rowId
},
dataType: 'json',
cache: false,
success: function (jsonData) {
myUitls.procAjaxMsg(jsonData, function () {
row.printFlag = row.printFlag == "" ? "" : "";
if (row.printFlag == "") {
$("#j_dgExamine").datagrid("updateRow", {
index: index,
row: row
})
$("#j_dgExamine").datagrid('beginEdit', index);
}
else {
$("#j_dgExamine").datagrid('endEdit', index);
$("#j_dgExamine").datagrid('cancelEdit', index);
} $(".datagrid-editable-input").attr("maxlength", )
}, function () {
myUitls.alertMsg(jsonData.Msg, '提示', null);
//取消确定按钮聚焦效果
myUitls.cancleFocus();
return;
});
}
});
}
},
样式代码:
/*有叉号样式*/
.item-selected {
width: 18px;
height: 18px;
float: right;
text-align: center;
background-image: url(../../../../images/area/Common/select_sel2.png);
cursor: pointer;
} /*无叉号样式*/
.item-unselected {
width: 18px;
height: 18px;
float: right;
text-align: center;
background-image: url(../../../../images/area/Common/select_nor2.png);
cursor: pointer;
}
onLoadSuccess: function (data) {
$(".datagrid-header-rownumber").html("序号");
$(".datagrid-header-rownumber").parent().next().css("display","none");
$(".datagrid-header-rownumber").attr("style", "width:65px !important;height:40px;line-height:40px;font-weight: 700;font-size: 14px;")
},
效果展示:
【easyui】关于easyui Datagrid一些样式记录的更多相关文章
- 关于easyui Datagrid一些样式记录
此篇文章主要记录在使用datagrid中常见的修改样式方式以及样式效果配图!!!! 一丶存在选中框的时候标题栏合并显示序号字段. 代码展示: onLoadSuccess: function (data ...
- easyui的datagrid的使用记录
datagrid是在 table的基础上变化而来的, 而不是在div的基础上来的. 从div来变成 datagrid,样式的设置还是是比较麻烦的. dg=datagrid 的标题 来源于 column ...
- Easyui datagrid 实现表格记录拖拽
datagrid 实现表格记录拖拽 by:授客 QQ:1033553122 测试环境 jquery-easyui-1.5.3 jquery-easyui-datagrid-dnd 下载地址: http ...
- [转]easyui常用控件及样式API中文收藏
[转]easyui常用控件及样式收藏 2013-05-06 23:01 30612人阅读 评论(0) 收藏 举报 分类: java ee(5) 目录(?)[+] CSS类定义: div easyu ...
- EasyUi控件Datagrid
很久没有打开我的博客园,刚刚大概扫了一眼我之前写的笔记,关于Devexpress那篇居然有四千多的浏览记录,不知道对浏览过的博友有没有起到一点点作用.当然我写笔记仅仅只是给自己留个记忆,如果歪打正着帮 ...
- jQuery EasyUI教程之datagrid应用(三)
今天继续之前的整理,上篇整理了datagrid的数据显示及其分页功能 获取数据库数据显示在datagrid中:jQuery EasyUI教程之datagrid应用(一) datagrid实现分页功能: ...
- jQuery EasyUI教程之datagrid应用(二)
上次写到了让数据库数据在网页datagrid显示,我们只是单纯的实现了显示,仔细看的话显示的信息并没有达到我们理想的效果,这里我们丰富一下: 上次显示的结果是这样的 点击查看上篇:jQuery Eas ...
- jQuery EasyUI教程之datagrid应用(一)
最近一段时间都在做人事系统的项目,主要用到了EasyUI,数据库操作,然后抽点时间整理一下EasyUI的内容. 这里我们就以一个简洁的电话簿软件为基础,具体地说一下datagrid应用吧 datagr ...
- easyUI中点击datagrid列标题排序
easyUI中点击datagrid的排序有两种,一种是本地的,一种是服务器的.本地的只能排序当前页,而服务器的可以对全部页进行排序.这里主要是分享下服务器排序. 1.为datagrid添加属性remo ...
随机推荐
- slecte下拉框的多选操作及获取值的 变化
对select增加一个 multiple属性,再获取多选的值的时候,对数据进行遍历,如果单纯的获取select的value值,指挥获取一个值, 遍历方法 可以先获取到select的dom元素到,然后对 ...
- Oracle存储过程,游标使用
Oracle存储过程: 语法: CREATE [OR REPLACE] PROCEDURE procedure_name (arg1 [mode1] datatype1,arg2 [mode2] da ...
- Django的一些隐性经验
隐性经验 前后信息的沟通 url中的参数 get获取 这个参数可以写在URL当中(可以写多个,写在这里的get函数需要有相应的参数去获取).,也可以在模版中添加(通过?若是直接写则表示在当前的URL中 ...
- zabbix学习
snmp 默认监控upd161端口 tcp 也有 [root@bogon ~]# netstat -nlutp|grep snmp tcp 0 0 127.0.0.1:199 0.0.0.0:* LI ...
- 数组-Array
1.数组的概念 /* 数组的格式 数组: 同一种数据类型的若干个值的容器 元素:数组中的值称为元素 索引:元素的标号,从0开始 长度:数组中元素的个数 */ public class ArrayDem ...
- day_2安装Python解释器和pycharm
首先我们复习一下昨天的内容 ···重点 1:进制转换:二进制 与 十六进制 1111 0101 1010 转换为 f5a 2:内存分布:堆区 和 栈区 计算机的原理: 控制器 运算器 存储器 inp ...
- DWARF 中的 Debug Info 格式
本周花了几天的时间来研究怎么在 breakpad [1, 2] 中加入打印函数参数的功能,以期其产生的 callstack 更具可读性,方便定位崩溃原因. 现代 ELF 中的调试信息基本是以 DWAR ...
- Android:weight,margin,padding详解实例
weight详解 weight是用来等比例划分区域的属性. 案例代码 <LinearLayout xmlns:android="http://schemas.android.com/a ...
- nRF52832 矩阵按键调试 同一列上的按键 任意两个按键 按下 检测不到低电平(电平拉不下来)
参考链接:https://blog.csdn.net/zhanghuaishu0/article/details/78505045 调试过程中发现 同一列上的按键 任意两个按键 按下 检测不到低电平( ...
- centos下如何使用sendmail发送邮件
最近在实施服务端日志监控脚本,需要对异常情况发送邮件通知相关责任人,记录下centos通过sendmail发送邮件的配置过程. 一.安装sendmail与mail 1.安装sendmail: 1) ...