Fix idoc table and improve iOS tables
This commit is contained in:
@@ -171,18 +171,10 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Neues Modal für die Config.html -->
|
||||
<div id="config-modal" class="modal">
|
||||
<div class="modal-content">
|
||||
<span class="close" onclick="closeConfigModal()">×</span>
|
||||
<!-- Hier das iframe, das Config.html lädt -->
|
||||
<iframe id="config-iframe" src=""></iframe>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
let rawTable;
|
||||
const url = sessionStorage.getItem("url");
|
||||
<script>
|
||||
let rawTable;
|
||||
let importHot;
|
||||
const url = sessionStorage.getItem("url");
|
||||
|
||||
function fetchTreeData() {
|
||||
fetch(url + '/backend/api/getStations', {
|
||||
@@ -201,6 +193,10 @@
|
||||
const tree = document.getElementById("tree");
|
||||
tree.innerHTML = "";
|
||||
tree.className = "touch-tree";
|
||||
if (!Array.isArray(data) || data.length === 0) {
|
||||
tree.innerHTML = "<p class=\"empty-state\">Keine Stationen gefunden.</p>";
|
||||
return;
|
||||
}
|
||||
tree.appendChild(buildTouchTree(data));
|
||||
}
|
||||
|
||||
@@ -215,7 +211,7 @@
|
||||
if (children.length > 0) {
|
||||
const group = document.createElement("details");
|
||||
group.className = "touch-tree-group";
|
||||
group.open = true;
|
||||
group.open = false;
|
||||
|
||||
const summary = document.createElement("summary");
|
||||
summary.textContent = title;
|
||||
@@ -279,18 +275,30 @@
|
||||
reader.onload = function(event) {
|
||||
const workbook = XLSX.read(event.target.result, { type: "binary" });
|
||||
const sheet = workbook.Sheets[workbook.SheetNames[0]];
|
||||
const data = XLSX.utils.sheet_to_json(sheet);
|
||||
rawTable = data;
|
||||
|
||||
const container = document.getElementById("import-table");
|
||||
new Handsontable(container, {
|
||||
data,
|
||||
colHeaders: Object.keys(data[0]),
|
||||
rowHeaders: true,
|
||||
width: '100%',
|
||||
height: 300,
|
||||
licenseKey: 'non-commercial-and-evaluation'
|
||||
});
|
||||
const data = XLSX.utils.sheet_to_json(sheet);
|
||||
if (!data.length) {
|
||||
alert("Keine Daten in der Datei gefunden.");
|
||||
return;
|
||||
}
|
||||
rawTable = data;
|
||||
|
||||
const container = document.getElementById("import-table");
|
||||
if (importHot) {
|
||||
importHot.destroy();
|
||||
}
|
||||
importHot = new Handsontable(container, {
|
||||
data,
|
||||
colHeaders: Object.keys(data[0]),
|
||||
rowHeaders: true,
|
||||
width: '100%',
|
||||
height: 360,
|
||||
stretchH: 'all',
|
||||
autoColumnSize: false,
|
||||
manualColumnResize: true,
|
||||
colWidths: 120,
|
||||
wordWrap: false,
|
||||
licenseKey: 'non-commercial-and-evaluation'
|
||||
});
|
||||
};
|
||||
reader.readAsBinaryString(fileInput.files[0]);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user