easy-ui的datagrid
<div id="magazineGrid"></div>
<script>
$('#magazineGrid').datagrid({
height: 340,
//在创建完成后会根据url请求数据,通过ajax完成
url: '<c:url value="/kpOutSystem/view.do?op=getList"/>',
method: 'POST',
queryParams: { 'id': id },
idField: '产品ID', //该列为唯一列
striped: true, //交替显示行背景
fitColumns: true, //自动使列适应表格宽度以防水平滚动
singleSelect: false, //只允许选择一行
rownumbers: true, //显示行号
nowrap: false, //当数据长度超出列宽时会自动截取
pagination: false,//是否分页
pageNumber:50, //设置分页时,初始化分页码
pageSize: 10, //设置分页时,初始化每页记录数
pageList: [10, 20, 50, 100, 150], //设置分页时,初始化每页记录数列表
showFooter: true, //是否显示表底(可以显示总计)
//多表头
columns: [[
{ title: '',colspan:3 },
{ title: '',colspan:3},
],[
{ field: 'ck', checkbox: true },//添加了checkbox列,自适应宽度
{ field: '刊名', title: '刊名', width: 180, align: 'left' },
{ field: '类别', title: '类别', width: 150, align: 'left' },
{ field: '月份', title: '月份', width: 100, align: 'left' },
{ field: '价格', title: '价格', width: 100, align: 'right',hidden:true, },//隐藏
{ field: '数量', title: '数量', width: 80, align: 'left',
editor: {//行编辑的功能
type: 'numberbox',
options: {//对应具体配置
min: 0,
precision: 0
}
}
}
]], onBeforeLoad: function (param) {//ajax请求添加查询条件
var bId = $("#txtBId").val();
var AllSearchKey = $("#txtAllSearchKey").val();
param.bId = bId;
param.AllSearchKey = AllSearchKey;
}, onLoadSuccess: function (data) {
}, onLoadError: function () {
}, onClickCell: function (rowIndex, field, value) {
}
});
</script>
------
<table id="dataTable"></table> <script>
var rowData = $('#dataTable').datagrid('getSelected');//获取所选行 function makeDataGrid(){
var sbstr = "";
$('#dataTable').datagrid({
nowrap: true,
striped: true,
url:'<c:url value="/groupInvoice/view.do?op=getInvoiceList"/>',
//在创建完成后会根据url请求数据,通过ajax完成
pageSize:20,
pageNumber:1,
pageList:[10,20,50],
remoteSort:false,
columns:[[
{field:'payBillID',title:'支付号',sortable:true,checkbox:true},
{field:'errorMsg',title:'错误信息 ',sortable:true,
formatter:function(value,row,index){
if(value !=null){
return "<font color='red'>"+value+"</font>";
}
}
},
{field:'payId',title:'payId',sortable:true,hidden:true},
{field:'adminName',title:'学员代码',sortable:true},
{field:'idCard',title:'身份证号',sortable:true},
{field:'outSystemSign',title:'外系统编码 ',sortable:true},
{field:'payMoney',title:'支付金额 ',sortable:true},
{field:'payTime',title:'支付时间 ',sortable:true,
formatter:function(value,row,index){
if(value !=null){
var result =genStrDateTimeAll(value);
return result;
}
}
},
{field:'bankReturnTime',title:'返回时间',sortable:true,
formatter:function(value,row,index){
if(value != null){
var result = genStrDateTimeAll(value);
return result;
}
}
},
{field:'invoiceStatus',title:'发票状态',sortable:true,
formatter:function(value,row,index){
var payBillID = row.payBillID;
var payMoney = row.payMoney;
var adminName = row.adminName;
var parm = "";
parm += "&payBillID="+payBillID;
parm += "&payMoney="+payMoney;
parm += "&adminName="+adminName;
if(value == 0 || value == 9){
return "新申请";
}else{
return "未申请";
}
}
},
]], queryParams: {
payTimeStart: '${payTimeStart}' ,
payTimeEnd: '${payTimeEnd}',
outSystemSign: '${outSystemSign}',
groupID:'${groupID}'
},
pagination:true,
rownumbers:true,
onLoadSuccess:clearSelections /* 动态控制复选框
onLoadSuccess: function(data){
if (data.rows.length > 0) {
//循环判断操作为新增的不能选择
for (var i = 0; i < data.rows.length; i++) {
//根据operate让某些行不可选
if (data.rows[i].invoiceStatus == 8|| data.rows[i].invoiceStatus == 13||data.rows[i].invoiceStatus == 14 ) {
$("input[type='checkbox']")[i + 1].disabled = true;
}
}
}
}, onClickRow: function(rowIndex, rowData){
//加载完毕后获取所有的checkbox遍历
$("input[type='checkbox']").each(function(index, el){
//如果当前的复选框不可选,则不让其选中
if (el.disabled == true) {
$('#dataTable').datagrid('unselectRow', index - 1);
}
})
}*/
});
}
</script>
easy-ui的datagrid的更多相关文章
- 让Easy UI 的DataGrid直接内嵌的JSON对象,并重写form load 方法
前言 我有这样的JSON对象 { "UserName": "jf", "UserPwd": "123456", &quo ...
- easy ui datagrid 让某行复选框不能选中
//百度查找出来的 onLoadSuccess: function(data){//加载完毕后获取所有的checkbox遍历 if (data.rows.length > ...
- easy ui datagrid 增,删,改,查等基本操作
如下图: ①列表信息图 ②添加信息图 ③修改信息图 html代码: <%@ Page Title="" Language="C#" MasterPageF ...
- JQuery Easy Ui dataGrid 数据表格 ---制作查询下拉菜单
JQuery Easy Ui dataGrid 数据表格 数据表格 - DataGrid 继承$.fn.panel.defaults,使用$.fn.datagrid.defaults重载默认值.. 数 ...
- Jquery Easy UI Datagrid 上下移动批量保存数据
DataGrid with 上下移动批量保存数据 通过前端变量保存修改数据集合,一次性提交后台执行 本想结合easyui 自带的$('#dg').datagrid('getChanges'); 方法来 ...
- Easy UI form表单提交 IE浏览器不执行success ,以及 datagrid 展示过慢
最近在做一个Easy ui的项目 发现了一些问题,在这里总结下 1.表单提交,后端代码 public ActionResult Save(Request model) { ResultInfo _in ...
- Struts2 easy UI插件
一.easy UI是类似于jQuery UI的插件库,它提供了丰富的各种常用插件:tree.datagrid... tree插件: 语法:$(selector).tree([settings]); 常 ...
- Easy UI常用插件使用
一.easy UI是类似于jQuery UI的插件库,它提供了丰富的各种常用插件:tree.datagrid... tree插件: 语法:$(selector).tree([settings]); 常 ...
- easy ui插件
简介: easy UI是类似于jQuery UI的插件库 注意:多脚本同时使用时,注意脚本冲突问题. 常用插件: 1.tree插件(tree插件实现动态树形菜单) 2.datagrid插件(datag ...
- easy ui 1.4的NumberBox,失去焦点后不能再次输入小数点
这也是1.4版本的bug,现在1.4.1也发布了,经验证,该问题在新版本中已经解决了 在网上找到的解决办法,地址:http://www.jeasyui.com/forum/index.php?topi ...
随机推荐
- RabbitMQ不讲武德,发个消息也这么多花招
前言 本篇博客已被收录GitHub:https://zhouwenxing.github.io/ 文中所涉及的源码也已被收录GitHub:https://github.com/zhouwenxing/ ...
- 文本单词one-hot编码
单词->字母->向量 神经网络是建立在数学的基础上进行计算的,因此对数字更敏感,不管是什么样的特征数据都需要以向量的形式喂入神经网络,无论是图片.文本.音频.视频都是一样. one-hot ...
- Playwright VS Selenium VS Puppeteer VS Cypress
参考:https://www.testim.io/blog/puppeteer-selenium-playwright-cypress-how-to-choose/ 这四款自动化测试框架在我们的公众号 ...
- shell脚本学习之6小时搞定(1)
shell脚本学习之6小时搞定(1) 简介 Shell是一种脚本语言,那么,就必须有解释器来执行这些脚本. Unix/Linux上常见的Shell脚本解释器有bash.sh.csh.ksh等,习惯上把 ...
- linux操作系统可以ping通ssh连接长时间无响应
一.问题描述 某集群数据节点服务器频繁无法连接,服务器间出现可ping通但ssh无法连接的情况,使用带外地址登录后远程控制也无法显示正常界面,重启后会短暂恢复. 二.排查问题 重启服务器后检查服务器S ...
- rocketmq-cpp-client Visual Studio 2019 编译
rocketmq-cpp-client Visual Studio 2019 编译 rocketmq-cpp-client 是rocketmq c++版本的 所以我们C++ 开发者使用此项目 构建 获 ...
- 更改mysql的密码
mysql> set password for 'root'@'localhost' =PASSWORD('');Query OK, 0 rows affected (0.17 sec) mys ...
- 【Docker】/usr/bin/docker-current: Cannot connect to the Docker daemon at unix
------------------------------------------------------------------------------------------------- | ...
- 【Oracle】oracle pctfree和pctused详解
oracle pctfree和pctused详解 一.建立表时候,注意PCTFREE参数的作用 PCTFREE:为一个块保留的空间百分比,表示数据块在什么情况下可以被insert,默认是10,表示当数 ...
- 构造无字母数字Webshell
异或: 补充: A的ascii为65,对应二进制是01000001 <?php echo "1"^"A"; ?> 将"A"和&q ...