码迷,mamicode.com
首页 > Web开发 > 详细

jquery easyui中gridview用getData获取显示的所有数据

时间:2015-03-20 14:10:40      阅读:171      评论:0      收藏:0      [点我收藏+]

标签:

前台(提交方法):

$("#btnQueDing").click(function () {

 var rows = $(‘#dg‘).datagrid(‘getData‘); 

if ($("#iptZiDingYiMuBanMingCheng").attr("value") == "") {ZhongWenMingCheng
$.messager.alert(‘警告‘, ‘请先填写模板名称!‘);
return;
} else {
$.ajax({
type: "POST",
url: "/KaoHeMuBan/AddZiDingYiMuBan?MingCheng=" + $("#iptZiDingYiMuBanMingCheng").attr("value") + "&MuBanLeiXing=" + $(‘#selZiDingYi‘).combobox(‘getText‘) + "&BeiZhu=" + $("#ZiDingYiBeiZhu").attr("value") + "&LieLeiXing=" + JSON.stringify(rows.rows),
//data: "MingCheng=" + $("iptZiDingYiMuBanMingCheng").attr("value") + "&MuBanLeiXing=" + $(‘#selZiDingYi‘).combobox(‘getText‘) + "&BeiZhu=" + $("#BeiZhu").attr("value") + "&LieLeiXing=" + dgdata,
success: function (msg) {
ShuaXin(); 
$.messager.alert(‘提示‘, msg);
}
})

})

 

后台接收方法:

 

public class ccccccc
{
public string ZhongWenMingCheng { get; set; }
public string KaoPingXiangLeiXing { get; set; }
}

public string AddMuBan(string LieLeiXing)
{

try
{

#region MyRegion添加
List<ccccccc> jsonlist = new List<ccccccc>();//实例化
List<MuBan> listxm = JsonConvert.DeserializeObject<List<MuBan>>(LieLeiXing);//json反序列操作

for (int i = 0; i < listxm.Count; i++)
{
MuBan ximu = new MuBan(); 
ximu.MingCheng= listxm[i].MingCheng; 
ximu.LeiXing = listxm[i].LeiXing;

tmbxmBLL.Insert(ximu);//添加方法

return "添加成功";
#endregion

}
catch
{
return "添加失败";
}
}

jquery easyui中gridview用getData获取显示的所有数据

标签:

原文地址:http://www.cnblogs.com/xiaojiangfeng/p/4353444.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!