Add varieties
This commit is contained in:
40
resources/views/components/js/datatable.blade.php
Normal file
40
resources/views/components/js/datatable.blade.php
Normal file
@@ -0,0 +1,40 @@
|
||||
<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 () {
|
||||
$('.btn-edit').click(function() {
|
||||
url = '{{ $route }}' + '/edit/' + $(this).data('id');
|
||||
window.location = url;
|
||||
});
|
||||
|
||||
|
||||
$('.btn-del').on('click', '.destroy', function (e) {
|
||||
e.preventDefault();
|
||||
|
||||
bootbox.confirm("{{ __('boilerplate::shop.admin.confirmdelete') }}", function (result) {
|
||||
if (result === false) return;
|
||||
|
||||
$.ajax({
|
||||
url: href,
|
||||
method: 'delete',
|
||||
headers: {'X-CSRF-TOKEN': '{{ csrf_token() }}'},
|
||||
success: function(){
|
||||
line.remove();
|
||||
growl("{{ __('boilerplate::shop.admin.deletesuccess') }}", 'success');
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
});
|
||||
</script>
|
||||
Reference in New Issue
Block a user