当前位置:网站首页>easyui datagrid 获取多条选中的数据进行操作
easyui datagrid 获取多条选中的数据进行操作
2022-07-26 21:15:00 【reg183】
easyui datagrid 获取多条选中的数据进行操作
function topCenter(msg) {
$.messager.show({
title: '提示',
msg: msg,
showType: 'slide',
style: {
right: '',
top: document.body.scrollTop + document.documentElement.scrollTop,
bottom: ''
}
});
}
function warning(msg) {
$.messager.alert('提示', msg, 'warning');
}
function confirmMsg(msg,func) {
$.messager.confirm('提示', msg, function (r) {
if (r) {
func();
}
});
}
function datagridFun(dg, url, fun) {
var param1, param2, param3;
switch (arguments.length) {
case 2: param1 = param2 = param3 = null; break;
case 3: param1 = arguments[2]; param2 = param3 = null; break;
case 4: param1 = arguments[2]; param2 = arguments[3]; param3 = null; break;
case 5: param1 = arguments[2]; param2 = arguments[3]; param3 = arguments[4]; break;
}
var datagrid = $('#'+dg);
var rows = datagrid.datagrid('getSelections');
if (rows.length <= 0) {
warning('请选中您要操作的数据!');
}
else {
confirmMsg('您共选择了' + rows.length + '条记录,继续吗?', function () {
var ids = [];
for (var i = 0, j = rows.length; i < j; i++) {
ids.push(rows[i].id);
}
ids.join(',');
$.post(url, {
id: ids.toString(), operator: $.cookie('user'),param1:param1,param2:param2,param3:param3 }, function (result) {
if (result.success) {
topCenter(result.msg); datagrid.datagrid('reload'); $('#recentOp').datagrid('reload');
if(fun != undefined) fun();
} else {
warning(result.msg);
}
}, 'json')
})
}
}
边栏推荐
猜你喜欢

Flash source code startup phase

Leetcode exercise - Sword finger offer II 005. maximum product of word length

If you do not add waitkey() function after imshow() function, it will not be displayed

Altium designer 22 Chinese character garbled

Just one dependency to give swagger a new skin, which is simple and cool

JMeter自定义日志与日志分析

补充—非线性规划

浏览器主页被篡改怎么办,主页被篡改恢复方法

The principle of normal equation method and its difference from gradient descent method

08 du 命令
随机推荐
吃透负载均衡
In depth analysis of the source code, why is the string class immutable? (hit me before you understand)
Jd.com: how does redis realize inventory deduction? How to prevent goods from being oversold?
Go----Go 语言中的标识符和关键字
08 du 命令
仅需一个依赖给Swagger换上新皮肤,既简单又炫酷~
Isilon 的OneFs常见操作命令(一)
Afnetworking understand
开发转测试:从零开始的6年自动化之路
AFNetworking了解
MOS 管示意图
实际权威来自信息优势
Japan approves the export of EUV photoresist to South Korea, and the crisis of Samsung and SK Hynix may be alleviated
js验证复杂密码
It is said that Samsung obtained EUV photoresist from Belgium
Pytorch 使用RNN模型构建人名分类器
day07-
Pinduoduo gets search term recommendation API
npm, npm中文文档, npm学习使用
1 - "pytorch deep learning practice" - linear model