Umschreiben nach Vorschrift JSON Dokumentation

This commit is contained in:
ja
2022-01-10 13:57:12 +01:00
parent d750ae4a19
commit 949721800d
2 changed files with 78 additions and 53 deletions

View File

@@ -423,40 +423,60 @@
//addNewRow(SDL,Bez,Datguenstig,KartNr)
// Pagemethods.filltable2(<%' =tbl_mainpage %> , SDL, Bez, Datguenstig, KartNr)
//}
var data = {
"Kennzeichen": id.split(',')[0]
};
var data = {};
data['Kennzeichen'] = id.split(',')[0];
$.ajax({
type: "POST",
url: "LKWs.aspx/filltable2",
contentType: "application/json; charset=utf-8",
dataType: "json",
async: "false",
data: JSON.stringify(data),
success: function (result) {
success: function (data) {
result = data.d;
// addheader();
let strHTML = '<tr><th><td>SDL-Nr</td></th><th><td>Bezeichnung</td></th><th><td>Gueltig bis</td></th><th><td>Karten Nummer</td></th></tr>';
alert('Horray! 200 status code!');
alert(result.d)
renderTable(result.d)
// alert(result.rows.length)
$(result).each(function () {
let row = $(this)[0];
strHTML += '<tr><td>' + row["SDL"] + '</td><td>' + row["Bez"] + '</td><td>' + row["Gueltigbis"] + '</td><td>' + row["KartNr"] + '</td></tr>';
alert(row)
$('#<%=tbl_mainpage.ClientID%>').innerHTML = strHTML;
});
},
error: function (jqXHR, textStatus, errorThrown) {
alert("Status:" + jqXHR.status + "\nStatusText: " + textStatus + "\nError:" + errorThrown);
}
});
});
function OnSuccess(result) {
addheader();
alert('Horray! 200 status code!');
alert(result.rows.length)
for (let i = 0; i < result.rows.length; i++) {
let row = $('<tr><td>' + result.rows[i].SDL + '</td><td>' + result.rows[i].Bez + '</td><td>' + result.rows[i].DateGueltig + '</td><td>' + result.rows[i].KartNr + '</td></tr>');
alert(row)
}
}
//filltable2(id.split(',')[0])
}
function doPostBack_M(id_M) {
let Speditionslabel = document.getElementById('<%=lbl_sped_Placeholder_M.ClientID%>');
let natplaceholder = document.getElementById('<%=lbl_Placeholder_M.ClientID%>');
alert(id_M)
let table_M = document.getElementById('<%=tablemain_m.ClientID%>');
let table_M = document.getElementById('<%=tbl_mainpage_M.ClientID%>');
let rowCount = table_M.rows.length;
for (let i = rowCount - 1; i > 0; i--) {
table_M.deleteRow(i);
}
Speditionslabel.textContent = id_M.split(',')[0];
natplaceholder.textContent = id_M.split(',')[1];
//debugger
//for (let i = 0; i <= 5; i++) {
// let SDL = "453543535434334543";
@@ -466,28 +486,36 @@
//addNewRow(SDL,Bez,Datguenstig,KartNr)
// Pagemethods.filltable2(<%' =tbl_mainpage_M%> , SDL, Bez, Datguenstig, KartNr)
//}
var data = {
"Kennzeichen": id_M.split(',')[0]
};
var data_m = {};
data_m['Kennzeichen'] = id.split(',')[0];
$.ajax({
type: "POST",
url: "LKWs.aspx/filltable2_M",
contentType: "application/json; charset=utf-8",
dataType: "json",
async: "false",
data: JSON.stringify(data),
success: function (data) {
data: JSON.stringify(data_m),
async: true,
success: function (data_m) {
result = data_m.d;
// addheader();
let strHTML = '<tr><th><td> SDL-Nr </td></th><th><td> Bezeichnung </td></th><th><td> Gueltig bis</td></th><th><td>Karten Nummer</td></th></tr>';
alert('Horray! 200 status code!');
alert('Horray! 200 status code!');
alert(data.d)
renderTable_M(data.d);
},
$(result).each(function () {
let row = $(this)[0];
strHTML += '<tr><td>' + row["SDL"] + '</td><td>' + row["Bez"] + '</td><td>' + row["Gueltigbis"] + '</td><td>' + row["KartNr"] + '</td></tr>';
alert(row)
$('#<%=tbl_mainpage_M.ClientID%>').innerHTML = strHTML;
});
},
error: function (jqXHR, textStatus, errorThrown) {
alert("Status:" + jqXHR.status + "\nStatusText: " + textStatus + "\nError:" + errorThrown);
}
});
}
});
//filltable2(id.split(',')[0])
}