update new Datatable

This commit is contained in:
Markus
2024-07-12 23:21:35 +02:00
parent 5cb2bb142b
commit eb028d1783
7 changed files with 133 additions and 21 deletions

View File

@@ -9,10 +9,20 @@ $(document).ready(function(){
info:false,
order: [[ 1, 'desc' ]],
ajax: { url: '/Ajax/getOverviewData', dataSrc:''},
dom: '<"toolbar">frt',
layout: {
topStart: {
buttons: [
{text:'Neue Rechnung',className:'btn-sm',action: function ( e, dt, node, config ) {
location.href = '/newBill/';
}},
]
},
topEnd: 'search'
},
// dom: '<"toolbar">frt',
columns: columns,
});
$("div.toolbar").html('<a class="btn-sm btn-secondary" href="/newBill" role="button">Neuer Eintrag</a>');
// $("div.toolbar").html('<a class="btn-sm btn-secondary" href="/newBill" role="button">Neuer Eintrag</a>');
// Add event listener for opening and closing details
$('#bookings tbody').on('click', 'td.dt-receiver', function () {collapseDetails($(this), datatable);} );
$('#bookings tbody').on('click', 'td.dt-datum', function () {location.href = '/editBill/'+getId($(this),datatable);});
@@ -25,10 +35,20 @@ $(document).ready(function(){
info:true,
order: [[ 1, 'desc' ]],
ajax: { url: '/Ajax/getToDosData', dataSrc:''},
dom: '<"top"i<"syncbutton">>frt<"bottom"lp><"clear">',
layout: {
topStart: {
buttons: [
{text:'Sync',className:'btn-sm',action: function ( e, dt, node, config ) {
location.href = '/syncScheduled/';
}},
]
},
topEnd: 'search'
},
// dom: '<"top"i<"syncbutton">>frt<"bottom"lp><"clear">',
columns: columns,
});
$("div.syncbutton").html('<a class="btn-sm btn-secondary" href="/syncScheduled" role="button">Sync</a>');
// $("div.syncbutton").html('<a class="btn-sm btn-secondary" href="/syncScheduled" role="button">Sync</a>');
// Add event listener for opening and closing details
$('#todos tbody').on('click', 'td.dt-receiver', function () {collapseDetails($(this), todos);} );
$('#todos tbody').on('click', 'td.dt-datum', function () {location.href = '/editBill/'+getId($(this),todos);});