easyui datagrid checkbox的相关属性整理
DataGrid其中与选择,勾选相关 DataGrid属性:
singleSelect boolean 如果为true,则只允许选择一行。 false
ctrlSelect boolean 在启用多行选择的时候允许使用Ctrl键+鼠标点击的方式进行多选操作。(该属性自1.3.6版开始可用)
checkOnSelect boolean 如果为true,当用户点击行的时候该复选框就会被选中或取消选中。如果为false,当用户仅在点击该复选框的时候才会呗选中或取消。(该属性自1.3版开始可用) true
selectOnCheck boolean 如果为true,单击复选框将永远选择行。如果为false,选择行将不选中复选框。(该属性自1.3版开始可用) DataGrid列是一个数组对象,该元素也是一个数组对象。元素数组里面的元素是一个配置对象,它用来定义每一个列字段。
checkbox boolean 如果为true,则显示复选框。该复选框列固定宽度。 DataGrid事件 onSelect rowIndex, rowData 在用户选择一行的时候触发,参数包括:rowIndex:选择的行的索引值,索引从0开始。rowData:对应于所选行的记录。
onUnselect rowIndex, rowData 在用户取消选择一行的时候触发,参数包括:rowIndex:选择的行的索引值,索引从0开始。rowData:对应于取消选择行的记录。
onSelectAll rows 在用户选择所有行的时候触发。
onUnselectAll rows 在用户取消选择所有行的时候触发。
onCheck rowIndex,rowData 在用户勾选一行的时候触发,参数包括:rowIndex:选中的行索引,索引从0开始。rowData:对应于所选行的记录。(该事件自1.3版开始可用)
onUncheck rowIndex,rowData 在用户取消勾选一行的时候触发,参数包括:rowIndex:选中的行索引,索引从0开始。rowData:对应于取消勾选行的记录。(该事件自1.3版开始可用)
onCheckAll rows 在用户勾选所有行的时候触发。(该事件自1.3版开始可用)
onUncheckAll rows 在用户取消勾选所有行的时候触发。(该事件自1.3版开始可用) 方法 getChecked none 在复选框呗选中的时候返回所有行。(该方法自1.3版开始可用)
getSelected none 返回第一个被选中的行或如果没有选中的行则返回null。
getSelections none 返回所有被选中的行,当没有记录被选中的时候将返回一个空数组。
clearSelections none 清除所有选择的行。
clearChecked none 清除所有勾选的行。(该方法自1.3.2版开始可用)
selectAll none 选择当前页中所有的行。
unselectAll none 取消选择所有当前页中所有的行。
selectRow index 选择一行,行索引从0开始。
selectRecord idValue 通过ID值参数选择一行。
unselectRow index 取消选择一行。
checkAll none 勾选当前页中的所有行。(该方法自1.3版开始可用)
uncheckAll none 取消勾选当前页中的所有行。(该方法自1.3版开始可用)
checkRow index 勾选一行,行索引从0开始。(该方法自1.3版开始可用)
uncheckRow index 取消勾选一行,行索引从0开始。(该方法自1.3版开始可用)
项目代码实例
function findCustomerCanUseBailInfo(customerId,agencyId){
$('#t_customerCanReturn').datagrid(
{
idField : 'id', // 只要创建数据表格 就必须要加 ifField
title : null,
fit : true,
url : parent.baseUrl+ 'customer/bail/bailPayDetailsForAuctions?customerId='+customerId+'&&agencyId='+agencyId,
method : 'POST',
fitColumns : false,
nowrap : false,
striped : true, // 隔行变色特性S
loadMsg : '数据正在加载,请耐心的等待...',
rownumbers : true,
//sortName : 'customerNo',
//sortOrder : 'desc',
rowStyler : function(index, record) {
},
onSelect: function( rowIndex, rowData){
returnBailForAuctionsSum = Number(returnBailForAuctionsSum)+Number(rowData.canReturnBail);
$('#bailReturnSum').textbox('setValue',returnBailForAuctionsSum);
},
onUnselect: function (rowIndex, rowData) {
returnBailForAuctionsSum = Number(returnBailForAuctionsSum)-Number(rowData.canReturnBail);
$('#bailReturnSum').textbox('setValue',returnBailForAuctionsSum);
},
onSelectAll:function(rowIndex, rowData){
if (selectAllFlag == 1) {
var arr = $('#t_customerCanReturn').datagrid('getSelections');
if (arr.length <= 0) {
$('#bailReturnSum').textbox('setValue',returnBailForAuctionsSum);
return ;
}
returnBailForAuctionsSum = 0;
for (var i = 0; i < arr.length; i++) {
returnBailForAuctionsSum = Number(returnBailForAuctionsSum)+Number(arr[i].canReturnBail);
}
$('#bailReturnSum').textbox('setValue',returnBailForAuctionsSum);
}
},
onUnselectAll:function(rowIndex, rowData){
returnBailForAuctionsSum = 0;
$('#bailReturnSum').textbox('setValue',returnBailForAuctionsSum);
},
frozenColumns : [ [ // 冻结列特性 ,不要与fitColumns 特性一起使用
{
field : 'ck',
width : 50,
checkbox : true
} ] ],
columns : [ [ {
field : 'bailClass',
title : '保证金类别',
width : 75,
align : 'center',
formatter : returnFtt
},{
field : 'agencyName',
title : '市场名称',
width : 120,
align : 'center',
}, {
field : 'payWay',
title : '支付渠道',
width : 80,
align : 'center',
formatter : payWayFtt
}, {
field : 'bailPayMoney',
title : '缴纳金额',
width : 80,
align : 'center',
}, {
field : 'payWayName',
title : '支付方式',
width : 105,
align : 'center',
}, {
field : 'returnBailPay',
title : '已退金额',
width : 80,
align : 'center',
formatter : frozenFtt
}, {
field : 'canReturnBail',
title : '可退金额',
width : 105,
align : 'center',
formatter : frozenFtt
}, {
field : 'frozenMoney',
title : '冻结金额',
width : 80,
align : 'center',
formatter : frozenFtt
}, {
field : 'lockBailMoney',
title : '锁定金额',
width : 80,
align : 'center',
}, {
field : 'payTime',
title : '缴纳时间',
width : 180,
align : 'center',
},{
field : 'handlerWin',
title : '窗口',
width : 80,
align : 'center',
},{
field : 'remarks',
title : '备注',
width : 180,
align : 'center'
}/*, {
field : 'action',
title : '退款金额',
width : 120,
align : 'center',
formatter : returnBailFtt1
} */] ],
onLoadSuccess:function(){
$('#t_customerCanReturn').datagrid('selectAll');
var arr = $('#t_customerCanReturn').datagrid('getSelections');
if (arr.length <= 0) {
returnBailForAuctionsSum = 0;
$('#bailReturnSum').textbox('setValue',0);
return ;
}
returnBailForAuctionsSum = 0;
for (var i = 0; i < arr.length; i++) {
returnBailForAuctionsSum = Number(returnBailForAuctionsSum)+Number(arr[i].canReturnBail);
}
$('#bailReturnSum').textbox('setValue',returnBailForAuctionsSum);
selectAllFlag = 1;
},
/*pagination : true,
pageSize : 10,
pageList : [ 5, 10, 15, 20, 50 ],*/
}
);
}
function returnBailFtt1(){
var f = '<input type="text" style="width:100px;" value=""/>';
return f;
}
easyui datagrid checkbox的相关属性整理的更多相关文章
- easyui datagrid checkbox multiple columns have been done do
lengku1987 2013-01-06 22:27:47 Sponsored Links easyui datagrid checkbox multiple columns have ...
- jQuery EasyUI DataGrid Checkbox 数据设定与取值
纯粹做个记录,以免日后忘记该怎么设定. 这一篇将会说明两种使用 jQuery EasyUI DataGrid 的 Checkbox 设定方式,以及在既有数据下将 checked 为 true 的该笔数 ...
- EasyUI datagrid checkbox数据设定与取值(转自http://blog.csdn.net/baronyang/article/dnetails/9323463,感谢分享,谢谢)
这一篇将会说明两种使用 jQuery EasyUI DataGrid 的 Checkbox 设定方式,以及在既有数据下将 checked 为 true 的该笔数据列的 Checkbox 设定为 Che ...
- easyui datagrid 动态添加columns属性
公司在项目设计的时候,有一个需求,就是查出来的表的字段不唯一,一张表的字段可能是三个,也可能是五个,但是却要把它显示到页面,这个给我做ui的带来一点麻烦.因为以前一般用easyui 的datagrid ...
- easyui datagrid 表格组件列属性formatter和styler使用方法
明确单元格DOM结构 要想弄清楚formatter和styler属性是怎么工作的,首先要弄清楚datagrid组件内容单元格的DOM接口,注意,这里指的是内容单元格,不包括标题单元格,标题单元格的结构 ...
- easyui datagrid 绑定json对象属性的属性
今天用easyui 的datagrid绑定数据时,后台提供的数据是实体类类型的,其中有一个实体类A的属性b是另一个实体类B类型的,而前台需要显示b的属性c,这下就悲剧了,前台没法直接绑定了,后来脑筋一 ...
- EasyUI DataGrid Checkbox 多选 获取选中行中的内容
<table id='grid' class='easyui-datagrid' style='width:950px;height:405px' url='Ajax-index.php?mod ...
- easyui datagrid checkbox选中事件
$('#grid_Order').datagrid({ onCheck: function(index, data) { //alert(data[0]); / ...
- easyui datagrid checkbox复选框取消单击选中事件、初始全选全不选等问题解决
系统业务需要,导入的列表数据默认全部选中,且不可取消选中行.全部店铺优惠券发放过后导入的数据全部清空.如图所示: 一.初始化页面默认全部选中“selectAll”,全部不选中“unselectAll” ...
随机推荐
- 51nod数字1的数量
这道题瞎jbyy了很久 方法可能很奇怪... #include<cstdio> #include<cstring> #include<algorithm> #inc ...
- [BZOJ1391]解题报告|网络流的又一类建图&Dinic的若干优化
1391: [Ceoi2008]order 有N个工作,M种机器,每种机器你可以租或者买过来. 每个工作包括若干道工序,每道工序需要某种机器来完成,你可以通过购买或租用机器来完成. 现在给出这些参数, ...
- HDU 1840 Equations (数学)
title: Equations 数学 杭电1840 tags: [数学] 题目链接 Problem Description All the problems in this contest tota ...
- 斜率优化DP讲解
对于斜率优化的DP转移方程,一般以w[i]=max(w[j]+(sum[i]-sum[j])*v)的1D1D形式为主,直观看来就是前j个为若干个阶段,第j+1到第i个为一个阶段,每个阶段有自己的代价或 ...
- Opencv 中透视变换函数对IplImage图像变换时出现的问题?
最近一直在做视频稳像的项目,为了简化部分实现,使用了部分Opencv的函数,其中包括Opencv中对IplImage进行同时变换的函数cvWarpPerspective(src, dst,...) 发 ...
- Execute a terminal command from a Cocoa app
http://stackoverflow.com/questions/412562/execute-a-terminal-command-from-a-cocoa-app in the spirit ...
- 基于vlc sdk的二次开发--环境搭建、编译
前言 关于 搭建.编译VLC,不同的平台有不同的方法,可以参考wiki. 其中在windows下编译VLC有两种方式,MSYS+MinGW和CygWin.通过测试,最后决定采用MSYS+MinGW搭建 ...
- 网络知识===TCP/UDP的区别
TCP(传输控制协议,Transmission Control Protocol): 1)提供IP环境下的数据可靠传输(一台计算机发出的字节流会无差错的发往网络上的其他计算机,而且计算机A接收数据包的 ...
- python实战===一行代码就能搞定的事情!
打印9*9乘法表: >>> print( '\n'.join([' '.join(['%s*%s=%-2s' % (y,x,x*y) for y in range(1,x+1)]) ...
- mysql数据库设计之物理设计
一.存储引擎 推荐使用Innodb,这也是mysql默认使用的存储引擎,支持事务 二.属性的选择 字符选择: 1.char,存定长,速度快,存在空间浪费的可能,会处理尾部空格,上限255字节.(utf ...