Я использую SerializeArray и пытаюсь выдвинуть список объектов, но всегда равен нулю на стороне сервера.
var $form = $('#personelReqForm');
var model = $form.serializeArray();
model.Leavemembers = [],
model.MemberLanguages = [];
$.map($('#tblLeaveingMember tbody tr[data-id="0"]'),
function(obj) {
model.LeaveMembers.push({
MembershipId: $(obj).attr('data-mid'),
LeavingDate: $(obj).attr('data-date')
});
});
конец модели. Вид ..
(16) [{…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, LeaveMembers: Array(1), MemberLanguages: Array(0)]
0: {name: "Id", value: "0"}
1: {name: "TitleId", value: ""}
2: {name: "CompanyCardId", value: "2"}
3: {name: "DepartmentId", value: "175"}
4: {name: "ReasonId", value: "94"}
5: {name: "ContractTypeId", value: ""}
6: {name: "PersonnelGroupId", value: ""}
7: {name: "MembershipLevelId", value: ""}
8: {name: "TargetedStartDate", value: "24.10.2019"}
9: {name: "StationId", value: ""}
10: {name: "LanguageId", value: ""}
11: {name: "LanguageLevelId", value: ""}
12: {name: "Keywords", value: "<p><br></p>"}
13: {name: "Certificates", value: "<p><br></p>"}
14: {name: "ComputerSkills", value: "<p><br></p>"}
15: {name: "Description", value: "<p><br></p>"}
LeaveMembers: Array(1)
0: {MembershipId: "172024", LeavingDate: "24.10.2019"}
length: 1
__proto__: Array(0)
Как можно отправить всеобъекты с ajax? Спасибо ..