Fix some enhancements & new features
This commit is contained in:
@@ -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');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user