此篇文章主要记录在使用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 Datagrid一些样式记录的更多相关文章

  1. 【easyui】关于easyui Datagrid一些样式记录

    此篇文章主要记录在使用datagrid中常见的修改样式方式以及样式效果配图!!!! 一丶存在选中框的时候标题栏合并显示序号字段. 代码展示: onLoadSuccess: function (data ...

  2. Easyui datagrid 实现表格记录拖拽

    datagrid 实现表格记录拖拽 by:授客 QQ:1033553122 测试环境 jquery-easyui-1.5.3 jquery-easyui-datagrid-dnd 下载地址: http ...

  3. EasyUI - DataGrid 组建 - [ 样式功能 ]

    效果显示: 同上次博文效果. html代码: 同上次博文代码. js代码: align: 'center',//标题和内容居中 resizable: false,//不允许改变大小 //hidden: ...

  4. 去掉easyui datagrid内部虚线的方式。

    去掉easyui        datagrid内部虚线的方式.easyui datagrid的样式是统一写在样式文件中的,如果想要统一替换可以找对应的datagird样式文件中的以下部分.如果想要改 ...

  5. easyui的datagrid的使用记录

    datagrid是在 table的基础上变化而来的, 而不是在div的基础上来的. 从div来变成 datagrid,样式的设置还是是比较麻烦的. dg=datagrid 的标题 来源于 column ...

  6. EasyUI datagrid 删除的时候无法正确找到重复记录row index的问题

    EasyUI datagrid 删除的时候无法正确找到重复记录row index的问题: 如果无法正确找到重复记录的row index,就需要进行注意添加的时候所进行的 操作:如果添加的时候就是添加的 ...

  7. 浅谈jQuery easyui datagrid操作单元格样式

    今天项目上遇到问题,就是表格风格统一的问题,由于用了2个不同的框架,所以如果要大修比较麻烦,考虑到修改表格样式工作量会少很多,所以考虑修改jQuery easyui datagrid数据网格的样式. ...

  8. EasyUI datagrid优化

    easyui datagrid 在IE上加载速度慢, 150行数据就无法忍受了. firefox加载速度还可以. jquery easyui datagrid使用参考 http://www.cnblo ...

  9. 实现easyui datagrid在没有数据时显示相关提示内容

    本示例实现easyui datagrid加载/查询数据时,如果没有相关记录,则在datagrid中显示没有相关记录的提示信息,效果如下图所示 本实例要实现如下图所示的效果: 本示例easyui版本为1 ...

随机推荐

  1. Android重命名包名

    工程写的差不多了才发现原来用的包名还是自己尝试性的进行写代码的时候用到的.但apk的发布,google map api的申请等等方面都需要用到一个比较规范的包名.这就涉及到修改包名的问题. 包名一开始 ...

  2. AngularJS进阶(二十六)实现分页操作

    JS实现分页操作 前言 项目开发过程中,进行查询操作时有可能会检索出大量的满足条件的查询结果.在一页中显示全部查询结果会降低用户的体验感,故需要实现分页显示效果.受前面"JS实现时间选择插件 ...

  3. FFMPEG结构体分析:AVStream

    注:写了一系列的结构体的分析的文章,在这里列一个列表: FFMPEG结构体分析:AVFrame FFMPEG结构体分析:AVFormatContext FFMPEG结构体分析:AVCodecConte ...

  4. OM模块功能&API详解

    (一)销售订单概述 1.1   与车间模块关系 当使用ATO类型订单时,订单管理模块会直接在车间模块中产生任务 1.2   与库存模块关系 在销售订单中使用的物料,单位等信息均来自库存模块,在订单执行 ...

  5. Erlang cowboy routing 路由

    Erlang cowboy routing 路由 本文译自: http://ninenines.eu/docs/en/cowboy/1.0/guide/routing/ Routing 默认情况下,C ...

  6. 【Android 应用开发】BluetoothServerSocket详解

    一. BluetoorhServerSocket简介 1. 继承关系 public final class BluetoothServerSocket extends Object implement ...

  7. Android开发技巧——自定义控件之使用style

    Android开发技巧--自定义控件之使用style 回顾 在上一篇<Android开发技巧--自定义控件之自定义属性>中,我讲到了如何定义属性以及在自定义控件中获取这些属性的值,也提到了 ...

  8. 我如何踏上IT路

    第一次开技术博客,第一篇博文就聊聊自己是如何走上IT这条路的.一直听人说"搞IT的"颇含贬低色彩,也有IT前辈奉劝不要轻易踏上这条路,但最终我这个本是化学化工专业的门外汉还是义无反 ...

  9. C#中的var和dynamic

    在理解var和dynamic关键字之前,让我们先了解一下编程语言的类别. C#中有两类编程语言: 静态类型语言类别 动态语言类别 静态类型语言 静态类型语言也被称为强类型语言.所谓强类型语言,通俗的讲 ...

  10. SpringMvc+AngularJS通过CORS实现跨域方案

    什么是跨域请求问题? 这个问题的起因在于现代浏览器默认都会基于安全原因而阻止跨域的ajax请求,这是现代浏览器中必备的功能,但是往往给开发带来不便. 但跨域的需求却一直都在,为了跨域,勤劳勇敢的程序猿 ...