博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Nvelocity中全选+批量删除
阅读量:6985 次
发布时间:2019-06-27

本文共 1419 字,大约阅读时间需要 4 分钟。

写这篇的目的是存储一下小的知识点,以后拿来就可以使用。

ContractedBlock.gif
ExpandedBlockStart.gif
View Code
1   2  3  function DeleteList()  4         {
5 var chooseItem = ""; 6 jQuery("input[name='chkItem']").each(function () 7 {
8 if (this.checked == true) 9 {
10 var selectValue = this.value; 11 chooseItem += selectValue + ","; 12 } 13 }); 14 15 // 判断是否有选中 16 if (chooseItem == "") 17 {
18 alert("请至少选择一笔资料!"); 19 } 20 else 21 {
22 if (confirm("您确定要删除这些资料吗?")) 23 {
24 window.open("/SysMain/ListDelete.aspx?p_strIDList=" + chooseItem, "iframe_data"); 25 } 26 } 27 }

在controller的代码:

ContractedBlock.gif
ExpandedBlockStart.gif
controller Code
1 ///   2         /// 批量删除  3         ///   4         /// ID字符串  5         public void ListDelete(string p_strIDList)  6         {
7 CancelView(); 8 9 // 字符串截取并存入数组 10 string[] idList = p_strIDList.Split(','); 11 12 // 遍历数组,并删除 13 foreach (string id in idList) 14 {
15 if (!string.IsNullOrEmpty(id)) 16 {
17 HQLHelper.Delete(Convert.ToInt32(id), typeof(ROLE)); 18 } 19 }

转载地址:http://divpl.baihongyu.com/

你可能感兴趣的文章
经典SQL
查看>>
维基百科:主流移动设备的屏幕参数
查看>>
使用CGContext画线操作小记
查看>>
mysql fabric安装使用测试
查看>>
java 对 mongoDB 分组统计操作 以及一些常用操作
查看>>
当你扛不住的时候就读读
查看>>
解决安装rrdtool遇到的一个问题
查看>>
linux启动过程
查看>>
QString与LPCWSTR互转
查看>>
我的友情链接
查看>>
我的友情链接
查看>>
xmlUtil 解析 创建
查看>>
我的友情链接
查看>>
linux 命令(3)echo
查看>>
Nginx基础入门之nginx基础配置项介绍(2)
查看>>
一次详细全面的***报告
查看>>
c# 三种异步编程模型EAP(*)、 APM(*)和 TPL
查看>>
deepin-安装问题:unable to find a medium containing a live file
查看>>
用 Hasor 谈一谈MVC设计模式
查看>>
IE 条件注释
查看>>