summaryrefslogtreecommitdiffstats
path: root/dev/jquery.jtable.creation.js
diff options
context:
space:
mode:
Diffstat (limited to 'dev/jquery.jtable.creation.js')
-rw-r--r--dev/jquery.jtable.creation.js16
1 files changed, 8 insertions, 8 deletions
diff --git a/dev/jquery.jtable.creation.js b/dev/jquery.jtable.creation.js
index ddb6624..0cd6134 100644
--- a/dev/jquery.jtable.creation.js
+++ b/dev/jquery.jtable.creation.js
@@ -1,4 +1,4 @@
-/************************************************************************
+/************************************************************************
* CREATE RECORD extension for jTable *
*************************************************************************/
(function ($) {
@@ -80,7 +80,7 @@
}],
close: function () {
var $addRecordForm = self._$addRecordDiv.find('form').first();
- var $saveButton = $('#AddRecordDialogSaveButton');
+ var $saveButton = self._$addRecordDiv.parent().find('#AddRecordDialogSaveButton');
self._trigger("formClosed", null, { form: $addRecordForm, formType: 'create' });
self._setEnabledOfDialogButton($saveButton, true, self.options.messages.save);
$addRecordForm.remove();
@@ -109,7 +109,7 @@
_onSaveClickedOnCreateForm: function () {
var self = this;
- var $saveButton = $('#AddRecordDialogSaveButton');
+ var $saveButton = self._$addRecordDiv.parent().find('#AddRecordDialogSaveButton');
var $addRecordForm = self._$addRecordDiv.find('form');
if (self._trigger("formSubmitting", null, { form: $addRecordForm, formType: 'create' }) != false) {
@@ -151,7 +151,7 @@
isNewRow: true,
animationsEnabled: options.animationsEnabled
});
-
+
options.success();
return;
}
@@ -165,7 +165,7 @@
options.error(data);
return;
}
-
+
if(!data.Record) {
self._logError('Server must return the created Record object.');
options.error(data);
@@ -173,7 +173,7 @@
}
self._onRecordAdded(data);
-
+
self._addRow(
self._createRowFromRecord(data.Record), {
isNewRow: true,
@@ -262,13 +262,13 @@
self.options.actions.createAction,
$addRecordForm.serialize(),
function (data) {
-
+
if (data.Result != 'OK') {
self._showError(data.Message);
self._setEnabledOfDialogButton($saveButton, true, self.options.messages.save);
return;
}
-
+
if (!data.Record) {
self._logError('Server must return the created Record object.');
self._setEnabledOfDialogButton($saveButton, true, self.options.messages.save);