Fix some enhancements & new features

This commit is contained in:
Ludovic CANDELLIER
2020-07-26 16:51:45 +02:00
parent fcd26d13de
commit 1179b5ca31
54 changed files with 975 additions and 341 deletions

View File

@@ -1,11 +1,3 @@
<script>
$.extend( true, $.fn.dataTable.defaults, {
language: {
url: "/assets/vendor/boilerplate/js/datatables/i18n/French.json"
},
});
</script>
{{$dataTable->scripts()}}
<script>
@@ -14,22 +6,27 @@
var table = window.LaravelDataTables["{{ $model }}-table"];
$('.btn-edit').off('click').click(function() {
var id = table.row(this).id();
$('.btn-edit').off('click').click(function(e) {
e.preventDefault();
// var id = table.row(this).id();
var id = $(this).data('id');
url = '{{ $route }}' + '/edit/' + id;
console.log(url);
openURL(url);
});
$('.btn-show').off('click').click(function() {
var id = table.row(this).id();
$('.btn-show').off('click').click(function(e) {
e.preventDefault();
// var id = table.row(this).id();
var id = $(this).data('id');
url = '{{ $route }}' + '/show/' + id;
openURL(url);
});
$('.btn-del').off('click').click(function (e) {
e.preventDefault();
var id = table.row(this).id();
// var id = table.row(this).id();
var id = $(this).data('id');
bootbox.confirm("{{ __('admin.confirmdelete') }}", function (result) {
if (result === false) return;
@@ -39,7 +36,7 @@
method: 'delete',
headers: {'X-CSRF-TOKEN': '{{ csrf_token() }}'},
success: function(){
line.remove();
// line.remove();
table.draw();
growl("{{ __('admin.deletesuccess') }}", 'success');
}