如何将表单数据和行选择的数据从jqGrid绑定到服务器?
我有一个 jgrid,在选择和提交行时,我必须提交包含两个日期字段的 url 的数据...如何在提交到服务器时将表单和所选行的值绑定在一起?
不,我们将不胜感激。谢谢!
更新1:
jQuery(".sorder").click(function() {
var earliestDate = jQuery("input#e").val();
var latestTimeDate = jQuery("input#e").val();
var grid = jQuery("#orderPreview");
var id = grid.jqGrid('getGridParam', 'selrow');
if (id) {
var ret = grid.jqGrid('getRowData', id);
}
$.ajax( {
type : "POST",
url : "/cpsb/internalOrderList.do",
data : {
method : "create",
lpn : ret.licensePlateNumber,
sku : ret.sku,
description:ret.description,
cases:ret.caseQuantity,
hold:ret.isHeld,
earliestDate:earliestDate,
latestTimeDate:latestTimeDate
}
});
});
I have a jgrid and on selectiing and submitting the row I have to submit the for data with that url which contains two date field... How can I bind the values of form and selected row together on submit to server?
Nay help will be appreciated.. Thanks!
Update 1:
jQuery(".sorder").click(function() {
var earliestDate = jQuery("input#e").val();
var latestTimeDate = jQuery("input#e").val();
var grid = jQuery("#orderPreview");
var id = grid.jqGrid('getGridParam', 'selrow');
if (id) {
var ret = grid.jqGrid('getRowData', id);
}
$.ajax( {
type : "POST",
url : "/cpsb/internalOrderList.do",
data : {
method : "create",
lpn : ret.licensePlateNumber,
sku : ret.sku,
description:ret.description,
cases:ret.caseQuantity,
hold:ret.isHeld,
earliestDate:earliestDate,
latestTimeDate:latestTimeDate
}
});
});
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以从网格中获取数据,
然后可以使用它
立即发送数据。因为数据将按 POST 而不是按 GET 发送,所以没有 URL 限制。
顺便说一下,在您的代码中,您
可能在其中一行中使用了 id“e”,应该更改。
You can get the data from the grid with
then you can use
to send the data at once. Because the data will be send per POST and not per GET you have no URL restriction.
By the way in your code you use
probably in one of the row the id "e" should be changed.