永发信息网

Jquery easyui 怎么得到datagrid 里面的值和传到后台

答案:2  悬赏:80  手机版
解决时间 2021-01-03 09:19
精选

最佳答案
var insertRows = $('#test').datagrid('getChanges','inserted');
var updateRows = $('#test').datagrid('getChanges','updated');
var deleteRows = $('#test').datagrid('getChanges','deleted');
var changesRows = {
inserted : [],
updated : [],
deleted : [],
};
if (insertRows.length>0) {
for (var i=0;i changesRows.inserted.push(insertRows[i]);
}
}

if (updateRows.length>0) {
for (var k=0;k changesRows.updated.push(updateRows[k]);
}
}

if (deleteRows.length>0) {
for (var j=0;j changesRows.deleted.push(deleteRows[j]);
}
}

$.ajax({
type: "post",
url: "../stock/stock_modify.asp",

data: "inserted="+JSON.stringify(changesRows.inserted)+"&updated="+JSON.stringify(changesRows.updated)+"&deleted="+JSON.stringify(changesRows.deleted),
datatype: "json",
success:function(data){

}

})

以上是针对插入删除更新 操作
全部回答
您好:得到datagrid的数据有好几种。 getdata() return the loaded data. getrows() return the current page rows. getfooterrows() return the footer rows. getrowindex() return the specified row index, the row parameter can be a row record or an id field value. getchecked() return all rows where the checkbox has been checked. this method is available since version 1.3. getselected() return the first selected row record or null. getselections() return all selected rows, when no record selected, am empty array will return. 传到后台的话直接ajax提交即可。
我要举报
如以上问答信息为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
魔卡少女樱 CLEAR CARD篇百度云
用配方法把代数式x2-4x+5变形,所得结果是A.
梦见奔跑
已知△ABC的三条边长分别为3cm,4cm,5cm,△
两个月小泰迪毛变浅是怎么回事
扣款通知单怎么写得????
把一只温度计从20℃的酒精中取出后放到20℃的
老公天天不刷牙怎么办 烦死了
阅读下面古诗,完成后面题目。赤壁杜牧折戟沉
起名柠字配什么字好听
单选题19世纪60年代,俄、日两国资产阶级改革
It was because I like you I speak out fra
牛是哪一年
开什么加工厂好
经常喝什么泡的水,能防电脑辐射?
推荐资讯
网络工作有哪些
文件处理传阅处理签上承办意见怎么写
做一个app应用程序大概需要多少钱 200分
单选题基因型为AaBb和aaBb的两个体杂交(按自
伤残保险公司不挂床不给务工费吗
如何市场细分
福庆堂凉茶这个地址在什么地方,我要处理点事
青云谱区文化广电旅游新闻出版局地址有知道的
3时30分,这时钟面上时针与分针的夹角是90°
单选题Thisgivesmeconfidence________.A.
.To deal with the global financial crisis
两组对边分别平行,且有四个直角的四边形是;
正方形一边上任一点到这个正方形两条对角线的
阴历怎么看 ?