More than one Table choose wich will be displayed
More than one Table choose wich will be displayed
I have a Problem!
I'm using Server-Side-Processing Post method, on top of the page i have different type's of Inputs (text, date, radio).
with the radio's the user choose which table/report layout will be displayed after a submit button is clicked.
at the moment i do it this way:
`$(document).ready(function() {
$('#create').click(function() {
if(document.getElementById('APC1').checked) {
$('#APC').DataTable( {
"ajax": {
"url": "scripts/SSP_Aktive_APC.php",
"type": "POST"
},
"columns": [
{ "data": "EVSOURCE", title: "Rechner" },
{ "data": "Dienststelle_Text", title: "Dienststelle" },
{ "data": "Teileinheit_Text", title: "Teileinheit" },
{ "data": "Liegenschaft_Text", title: "Liegenschaft" },
{ "data": "Standort", title: "Standort" }
],
});
}
if(document.getElementById('Devices1').checked) {
$('#Devices').DataTable( {
"ajax": {
"url": "scripts/SSP_Connected_Devices.php",
"type": "POST"
},
"columns": [
{ "data": "EVDEVICE", title: "Geräteklasse",
"render" : function(data, type, row, meta) {
var devi = data.split('::');
return type === "display" || type === "search" ?
devi[0] :
data;
}
},
{ "data": "EVDEVICE", title: "Anschlussart",
"render" : function(data, type, row, meta) {
var devi = data.split('::');
return type === "display" || type === "search" ?
devi[1] :
data;
}
},
{ "data": "EVDEVICE", title: "Gerät",
"render" : function(data, type, row, meta) {
var devi = data.split('::');
return type === "display" || type === "search" ?
devi[2] :
data;
}
}
]
});
}`
you see i have different Server-Side Processing Scripts which will be called when the radio is :checked and the Button create is clicked. if i do it this way my problem is, if a user click another time on the create button i'll get the message "Re-Initzialisation is not possible".
And it would be very nice if no table is displayed on first load of the page.