Chirurgia endoscopică a hipofizei
"Standardul de aur" în chirurgia hipofizară îl reprezintă endoscopia transnazală transsfenoidală. Echipa NeuroHope este antrenată în unul din cele mai mari centre de chirurgie a hipofizei din Europa, Spitalul Foch din Paris, centrul în care a fost introdus pentru prima dată endoscopul în chirurgia transnazală a hipofizei, de către neurochirurgul francez Guiot. Pe lângă tumorile cu origine hipofizară, prin tehnicile endoscopice transnazale pot fi abordate numeroase alte patologii neurochirurgicale. www.neurohope.ro |
Probleme cu DataTable
Last Updated: Oct 27 2023 10:46, Started by
geotux
, Oct 24 2023 13:30
·
2
#1
Posted 24 October 2023 - 13:30
Salut !
Folosesc DataTable pentru a afisa date dintr-o baza MySql http://86.127.36.60/...z/spot_1624.php Dupa ce se selecteaza luna, trebuie sa se schimbe continutul tabelului si graficului. Valorile se schimba si la tabel si la grafic, doar ca la tabel nu se incarca optiunile(e.g.: limitarea numarului de randuri, chekbox-uri la fiecare rand) <select class="form-control dropdown" id="dd" name="dd" onchange="selectSpecie()" style="width:200px;margin-left:20px;"> <option value="1">January</option> <option value="2">February</option> <option value="3">March</option> <option value="4">April</option> <option value="5">May</option> <option value="8">August</option> <option value="9">September</option> </select> si functia selectSpecie(): function selectSpecie() { var x1 = document.getElementById("dd").value; $.ajax({ url:"showResults.php", method: "POST", data:{id1 : x1}, success:function(data){ //Replace the table content with the data received through ajax $("#ans").html(data); //Initialize DataTables with the required options var table = new DataTable('#myTable', { dom: 'Bfrtip', buttons: [ { extend: 'excel', text: 'Excel', exportOptions: { rows: function(idx, data, node) { let found = false; if ($("#exportSelected").is(":checked")) { let selectedRowIndexes = table.rows('.selected').indexes(); for (let index = 0; index < selectedRowIndexes.length; index++) { if (idx == selectedRowIndexes[index]) { found = true; break; } } return found; } else { return true; } } } } ], columnDefs: [ { orderable: false, className: 'select-checkbox', targets: 0 } ], select: { style: 'multi', selector: 'td:first-child' }, order: [[1, 'asc']] }); // Make the table visible and expose the DataTables API. table.tables({visible: true, api: true}); // Destroy the DataTables object. table.destroy(); } }); } |
#2
Posted 24 October 2023 - 13:39
Eu am folosit fara probleme dupa urmatoarea logica :
- se iau datele in js si se creaza DataTable - cand se schimba datele se distruge si apoi se creaza din nou acel DataTable Din ce vad la tine n-ai facut destroy la inceput ? |
#3
Posted 27 October 2023 - 10:46
OK, am rezolvat:
function selectSpecie() { var x1 = document.getElementById("dd").value; $.ajax({ url: "showResults.php", method: "POST", data: { id1: x1 }, success: function (data) { DataTable .tables( { visible: true, api: true } ) .destroy(); //Replace the table content with the data received through ajax $("#ans").html(data); //Initialize DataTables with the required options var table = new DataTable("#myTable", { dom: "Bfrtip", buttons: [ { extend: "excel", text: "Excel", exportOptions: { rows: function (idx, data, node) { let found = false; if ($("#exportSelected").is(":checked")) { let selectedRowIndexes = table.rows(".selected").indexes(); for ( let index = 0; index < selectedRowIndexes.length; index++ ) { if (idx == selectedRowIndexes[index]) { found = true; break; } } return found; } else { return true; } }, }, }, ], columnDefs: [ { orderable: false, className: "select-checkbox", targets: 0, }, ], select: { style: "multi", selector: "td:first-child", }, order: [[1, "asc"]], }); }, }); } |
Anunturi
▶ 0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users