我使用.each類遍歷gridview,並將gridview的rowData逐一提交給ajaxsubmit。將行數據傳遞給jquery函數
一切似乎是工作正常。除了var rowData我不知道如何將它傳遞給ajaxsubmit。我曾嘗試使用「#rowData」,但它不起作用。
$("#submit").click(function() {
var record;
alert("starting");
$("#<%=GridView3.ClientID%> input[id*='chkEmployee']:checked").each(function() {
var rowData = {
"privateID": $(this).closest('tr').find('.IDName').text(),
"Company": $(this).closest('tr').find('.FName').text(),
"Dun": $(this).closest('tr').find('.DName').text()
};
$("#rowData").ajaxsubmit(
"./employeeAdd"
, function() {
jInfo("data base been sumitted"
}
);
});
});
有誰知道如何將rowData正確傳遞給ajaxsubmit嗎?謝謝