55 lines
1.2 KiB
PHP
55 lines
1.2 KiB
PHP
<script>
|
|
$.extend( true, $.fn.dataTable.defaults, {
|
|
language: {
|
|
url: "/assets/vendor/boilerplate/js/datatables/i18n/French.json"
|
|
},
|
|
});
|
|
</script>
|
|
|
|
{{$dataTable->scripts()}}
|
|
|
|
<script>
|
|
|
|
$('#{{ $model }}-table').on( 'draw.dt', function () {
|
|
|
|
var table = window.LaravelDataTables["{{ $model }}-table"];
|
|
|
|
$('.btn-edit').off('click').click(function() {
|
|
var id = table.row(this).id();
|
|
url = '{{ $route }}' + '/edit/' + id;
|
|
openURL(url);
|
|
});
|
|
|
|
$('.btn-show').off('click').click(function() {
|
|
|
|
var id = table.row(this).id();
|
|
url = '{{ $route }}' + '/show/' + id;
|
|
openURL(url);
|
|
});
|
|
|
|
$('.btn-del').off('click').click(function (e) {
|
|
e.preventDefault();
|
|
var id = table.row(this).id();
|
|
|
|
bootbox.confirm("{{ __('admin.confirmdelete') }}", function (result) {
|
|
if (result === false) return;
|
|
|
|
$.ajax({
|
|
url: '{{ $route }}' + '/destroy/' + id,
|
|
method: 'delete',
|
|
headers: {'X-CSRF-TOKEN': '{{ csrf_token() }}'},
|
|
success: function(){
|
|
line.remove();
|
|
table.draw();
|
|
growl("{{ __('admin.deletesuccess') }}", 'success');
|
|
}
|
|
});
|
|
});
|
|
});
|
|
|
|
});
|
|
|
|
// datatablesHelper.getDatatableLength('{{ $model }}', 34);
|
|
|
|
</script>
|