@@ -201,6 +201,13 @@
// handle apply changes button
$(document.body).on("click",".button_apply_changes", function() {
+ if (nNew || nEditing) {
+ var modal = $("#modal_error");
+ modal.find('.modal-body p').text("Previous record not saved. Please save it before applying the changes.");
+ modal.modal('show');
+ return;
+ }
+
var modal = $("#modal_apply_changes");
var table = $("#tbl_records").DataTable();
var domain = $(this).prop('id');
diff --git a/app/templates/template_edit.html b/app/templates/template_edit.html
index 5983a34..bba6f67 100644
--- a/app/templates/template_edit.html
+++ b/app/templates/template_edit.html
@@ -48,7 +48,7 @@
{% for record in records %}
-
+
{{ record.name }}
@@ -65,12 +65,12 @@
{{ record.data }}
-
-
+
Delete
@@ -187,6 +187,13 @@
// handle apply changes button
$(document.body).on("click",".button_apply_changes", function() {
+ if (nNew || nEditing) {
+ var modal = $("#modal_error");
+ modal.find('.modal-body p').text("Previous record not saved. Please save it before applying the changes.");
+ modal.modal('show');
+ return;
+ }
+
var modal = $("#modal_apply_changes");
var table = $("#tbl_records").DataTable();
var template = $(this).prop('id');