Browse Source

JS DataTable delete action func

Vova Tkach 6 years ago
parent
commit
c02b1f062c
2 changed files with 17 additions and 0 deletions
  1. 17 0
      assets/cp.scripts.js
  2. 0 0
      assets/cp.scripts.js.go

+ 17 - 0
assets/cp.scripts.js

@@ -50,6 +50,23 @@ function ActionIndexUserLogout() {
 	});
 }
 
+function ActionDataTableDelete(object, action, id, msg) {
+	if(confirm(msg)) {
+		$.ajax({
+			type: "POST",
+			url: '/cp/',
+			data: {
+				action: action,
+				id: id,
+			}
+		}).done(function(data) {
+			AjaxDone(data)
+		}).fail(function() {
+			AjaxFail();
+		});
+	}
+}
+
 $(document).ready(function() {
 	// Ajax forms
 	$('form').each(function() {

File diff suppressed because it is too large
+ 0 - 0
assets/cp.scripts.js.go


Some files were not shown because too many files changed in this diff