I am aware that this topic has been brought up hundreds time but I cannot find any solution in any forum which works:
var rows = $('#grid').jqxGrid('getrows');
var drtyRows = new Array();
for (var i = 0; i < rows.length; i++) {
if (rows[i].nar1 != 0) {
drtyRows.push(rows[i]);
}
}
var jsoo = JSON.stringify(drtyRows );
alert(jsoo); // shows data in jsoo correctly
$.ajax({
type: "POST",
cache: false,
dataType: "json",
url: "/Employee/Edit",
contentType: "application/json",
contentType: "application/json; charset=utf-8",
traditional: true,
async: false,
data: jsoo,
success: function (data) { alert("came back with Success"); },
failure: function (errMsg) {
alert(errMsg);
}
});
Ajax sends the array to the controller but there are only empty rows in it:
I have checked the posted and stringifyed variable before sending and it seems correct:
Any ideas?