Änderungen

This commit is contained in:
ja
2022-01-20 17:04:10 +01:00
parent dbfa657a2e
commit 9bdccd31ce
8 changed files with 2377 additions and 1948 deletions

View File

@@ -39,8 +39,30 @@
width: 53%;
border: 1px solid grey;
}
}
}
</style>
<script>
$(document).ready(function () {
function getChildren($row) {
var children = [];
while ($row.next().hasClass('child')) {
children.push($row.next());
$row = $row.next();
}
return children;
}
$('.parent').on('click', function () {
var children = getChildren($(this));
$.each(children, function () {
$(this).toggle();
})
});
})
</script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
@@ -88,7 +110,7 @@
<!-- <asp:Table ID="tbl_mainpage" ClientIDMode="Static" runat="server" Width="100%" style="background-color:#fff;overflow-y:auto;" CssClass="table table-striped col-12">
<asp:TableHeaderRow ID="headrow1" runat="server" style="background-color:#043381;color:#fff;height:10px"><asp:TableHeaderCell ID="tblhc_SDLNr">SDL-Nr</asp:TableHeaderCell><asp:TableHeaderCell ID="tblhc_Bez">Bezeichnung</asp:TableHeaderCell><asp:TableHeaderCell ID="tbl_gueltig">Gültig Bis</asp:TableHeaderCell><asp:TableHeaderCell ID="tblhc_KarteNr">Karten-Nummer</asp:TableHeaderCell></asp:TableHeaderRow>
</asp:Table>-->
<table runat="server" id="tablemain" class="col-12">
<table runat="server" id="tablemain" class="col-12 table table-hover">
<tr>
<td>Bitte Daten auswählen durch klicken der Buttons</td>
</tr>
@@ -134,7 +156,7 @@
<!-- <asp:Table ID="tbl_mainpage_M" ClientIDMode="Static" runat="server" Width="100%" CssClass="table table-striped col-12">
<asp:TableHeaderRow runat="server" ID="headrow_M" style="background-color:#043381;color:#fff"><asp:TableHeaderCell ID="tblhc_SDLNr_M">SDL_Nr</asp:TableHeaderCell><asp:TableHeaderCell ID="tblhc_Bez_M">Bezeichnung</asp:TableHeaderCell><asp:TableHeaderCell ID="tbl_gueltig_M">Gültig Bis</asp:TableHeaderCell><asp:TableHeaderCell ID="tblhc_KarteNr_M">Karten-Nummer</asp:TableHeaderCell></asp:TableHeaderRow>
</asp:Table>-->
<table runat="server" id="tablemain_m" class="col-12" style="width: 385.5px">
<table runat="server" id="tablemain_m" class="col-12 table table-hover" style="width: 385.5px">
<tr style="width: 385.5px">
<td>Bitte Daten auswählen durch Klicken der Buttons</td>
</tr>
@@ -508,7 +530,9 @@
//let strHTML4 = '<tr><td>878465464634</td><td>DIESEL</td><td>12/05/2026</td><td>151515313521351</td></tr>'
//alert('Horray! 200 status code!' + result[i]);
// alert(result.rows.length)
let strHTML4 = '<tr><td style="width:224.25px">' + result[i]["0"] + '</td><td style="width:224.25px">' + result[i]["1"] + '</td><td style="width:224.25px">' + result[i]["2"] + '</td><td style="width:224.25px">' + result[i]["3"] + '</td></tr>'
let strHTML4 = '<tr data-bs-toggle="collapse" data-bs-target="#accordion' + result[i]["3"] + '" class="clickable"><td style="width:224.25px">' + result[i]["0"] + '</td><td style="width:224.25px">' + result[i]["1"] + '</td><td style="width:224.25px">' + result[i]["2"] + '</td><td style="width:224.25px">' + result[i]["3"] + '</td><span class="sign"></span></tr><tr id="accordion' + result[i]["3"] + '" class="collapse accordion-collapse"><td colspan="4">' + testfunchtmlinhalt(id.split(',')[0] + ',' + result[i]["3"])+'</td><tr>'
//alert(strHTML4)
$('#<%=tablemain.ClientID%>').append(strHTML4);
}
@@ -565,14 +589,15 @@
//let strHTML4 = '<tr><td>878465464634</td><td>DIESEL</td><td>12/05/2026</td><td>151515313521351</td></tr>'
//alert('Horray! 200 status code!' + result[i]);
// alert(result.rows.length)
let strHTML4 = '<tr style="width:385.5px"><td style="width:96.375px">' + result[i]["0"] + '</td><td style="width:96.375px">' + result[i]["1"] + '</td><td style="width:96.375px">' + result[i]["2"] + '</td><td style="width:96.375px">' + result[i]["3"] + '</td></tr>'
detailtabelle_M(id_M.split(',')[0])
let strHTML4 = '<tr style="width:385.5px" data-bs-toggle="collapse" data-bs-target="#accordion_m' + result[i]["3"] + '" class="clickable"><td style="width:96.375px">' + result[i]["0"] + '</td><td style="width:96.375px">' + result[i]["1"] + '</td><td style="width:96.375px">' + result[i]["2"] + '</td><td style="width:96.375px">' + result[i]["3"] + '</td><span class="sign"></span></tr><tr id="accordion_m' + result[i]["3"] + '" class="collapse accordion-collapse"><td colspan="4">' + detailtabelle_M(id_M.split(',')[0] + ',' + result[i]["3"])+'</td><tr>'
//alert(strHTML4)
$('#<%=tablemain_m.ClientID%>').append(strHTML4);
}
//renderTable(data.d);
//alert(strHTML);
//alert(strHTML);
},
error: function (jqXHR, textStatus, errorThrown) {
alert("Status:" + jqXHR.status + "\nStatusText: " + textStatus + "\nError:" + errorThrown);
@@ -580,11 +605,116 @@
});
//filltable2(id.split(',')[0])
}
function testfunchtmlinhalt(id) {
alert(id.split(',')[0])
let strhtmlform_maut = `<div class="card"><label id="lbl_Schadstoffklasse">Schadstoffklasse:</label><input id="txt_Schadstoffklasse" readonly="readonly" runat="server" style="width: 45px; margin-left:12px" value="Text" /></div>
`
$.ajax({
url: url,
type: 'GET',
success: function (data) {
return $(data).find('#content').html();
},
error: function () {
alert("There was an error.");
}
});
}
function detailtabelle(id) {
alert(id)
alert("Testdata:" + id.split(',')[0])
let data = {};
data['Kennzeichen'] = id.split(',')[0];
$.ajax({
type: "POST",
url: "LKWs.aspx/filltabledetails",
contentType: "application/json; charset=utf-8",
dataType: "json",
async: "true",
data: JSON.stringify(data),
success: function (data) {
//alert(data.d.AaData)
result = data.d.AaData;
//addheader();
var rowCount = table_M.rows.length;
let tablewhole = {}
let tablestart = '<table>'
let tableend = '</table>'
let bodytable = ''
for (let i = rowCount - 1; i >= 0; i--) {
table_M.deleteRow(i);
}
tablewhole.push(tablestart)
for (var i = 0; i < result.length; i++) {
//let strHTML4 = '<tr><td>878465464634</td><td>DIESEL</td><td>12/05/2026</td><td>151515313521351</td></tr>'
//alert('Horray! 200 status code!' + result[i]);
// alert(result.rows.length)
let listdetailslisttemp = {}
for (let k = 0; k < result.AaData[i].length; k++) {
listdetailslisttemp.push(result.AaData[i])
}
alert(listdetailslisttemp.join(","))
let strhtmlform_maut = gethtmlofpage();
//let strlisttabledetails = '<ul class="list-group"><li data-bs-toggle="collapse" data-bs-target="#accordion' + id.split(',')[1] + '_1" class="list-group-item clickable">Gruppe1<span class="badge rounded-pill bg-primary">35</span></li><div id="accordion' + id.split(',')[1] + '_1" class="collapse accordion-collapse">data1</div></li><li class="list-group-item">Gruppe2<span class="badge rounded-pill bg-primary">25</span></li></ul>'
//let strHTML4 = '<tr style="width:385.5px" data-bs-toggle="collapse" data-bs-target="#accordion_m' + result[i]["3"] + '" class="clickable"><td style="width:96.375px">' + result[i]["0"] + '</td><td style="width:96.375px">' + result[i]["1"] + '</td><td style="width:96.375px">' + result[i]["2"] + '</td><td style="width:96.375px">' + result[i]["3"] + '</td><span class="sign"></span></tr><tr id="accordion_m' + result[i]["3"] + '" class="collapse accordion-collapse"><td colspan="4">' + detailtabelle_M(id_M.split(',')[0] + ',' + result[i]["3"])+'</td><tr>'
//alert(strHTML4)
tablewhole.push(strhtmlform_maut);
}
tablewhole.push(tableend)
return tablewhole.join(",");
//renderTable(data.d);
//alert(strHTML);
},
error: function (jqXHR, textStatus, errorThrown) {
alert("Status:" + jqXHR.status + "\nStatusText: " + textStatus + "\nError:" + errorThrown);
}
});
}
function detailtabelle_M(id_M) {
alert(id_M)
alert("Detail:" + id_M.split(',')[0])
var arrtemp = [];
// Data tables requires all data to be stuffed into a generic jagged array, so loop through our
// typed object and create one.
arrtemp.push([
"",
]);
let strlisttabledetails_M = '<ul class="list-group"><lidata-bs-toggle="collapse" data-bs-target="#accordion_m' + id.split(',')[1] + '_1" class="list-group-item clickable"><div id="accordion_m' + id.split(',')[1] + '_1" class="collapse accordion-collapse">Gruppe1<span class="badge rounded-pill bg-primary">35</span></div></li><li class="list-group-item">Gruppe2<span class="badge rounded-pill bg-primary">25</span></li></ul>'
return strlisttabledetails_M
}
</script>
<script>
function gethtmlofpage(url) {
let data = {};
data['url'] = url;
alert("before json");
$.ajax({
type: "POST",
url: "LKWs.aspx/gethtmltostring",
contentType: "application/json; charset=utf-8",
dataType: "json",
async: "true",
data: JSON.stringify(data),
success: OnSuccess,
failure: function (response) {
alert(response.d);
}
});
alert("after json");
}
function OnSuccess(response) {
alert(response);
return response
}
//filltable2(id.split(',')[0])
}
</script>
</asp:Content>