diff options
-rw-r--r-- | dev/jquery.jtable.core.js | 2 | ||||
-rw-r--r-- | dev/jquery.jtable.creation.js | 18 | ||||
-rw-r--r-- | dev/jquery.jtable.editing.js | 2 | ||||
-rw-r--r-- | dev/jquery.jtable.header.txt | 2 | ||||
-rw-r--r-- | lib/jquery.jtable.js | 24 | ||||
-rw-r--r-- | lib/jquery.jtable.min.js | 19 | ||||
-rw-r--r-- | lib/localization/jquery.jtable.es.js | 28 | ||||
-rw-r--r-- | lib/localization/jquery.jtable.vi.js | 26 |
8 files changed, 102 insertions, 19 deletions
diff --git a/dev/jquery.jtable.core.js b/dev/jquery.jtable.core.js index 6e5a091..0e3b80c 100644 --- a/dev/jquery.jtable.core.js +++ b/dev/jquery.jtable.core.js @@ -425,7 +425,7 @@ _createCellForRecordField: function (record, fieldName) {
return $('<td></td>')
.addClass(this.options.fields[fieldName].listClass)
- .append((this._getDisplayTextForRecordField(record, fieldName) || ''));
+ .append((this._getDisplayTextForRecordField(record, fieldName)));
},
/* Adds a list of records to the table.
diff --git a/dev/jquery.jtable.creation.js b/dev/jquery.jtable.creation.js index eb45dac..036ec22 100644 --- a/dev/jquery.jtable.creation.js +++ b/dev/jquery.jtable.creation.js @@ -164,6 +164,12 @@ options.error(data);
return;
}
+
+ if(!data.Record) {
+ self._logError('Server must return the created Record object.');
+ options.error(data);
+ return;
+ }
self._onRecordAdded(data);
@@ -199,8 +205,8 @@ var fieldName = self._fieldList[i];
var field = self.options.fields[fieldName];
- //Do not create input for fields that is key and not specially marked as editable
- if (field.key == true && field.edit != true) {
+ //Do not create input for fields that is key and not specially marked as creatable
+ if (field.key == true && field.create != true) {
continue;
}
@@ -243,12 +249,18 @@ $addRecordForm.attr('action'),
$addRecordForm.serialize(),
function (data) {
- //Check for errors
+
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);
+ return;
+ }
self._onRecordAdded(data);
self._addRow(
diff --git a/dev/jquery.jtable.editing.js b/dev/jquery.jtable.editing.js index 8b90ac0..40856c1 100644 --- a/dev/jquery.jtable.editing.js +++ b/dev/jquery.jtable.editing.js @@ -148,6 +148,8 @@ }
$.extend($updatingRow.data('record'), options.record);
+ self._updateRecordValuesFromServerResponse($updatingRow.data('record'), data);
+
self._updateRowTexts($updatingRow);
self._onRecordUpdated($updatingRow, data);
if (options.animationsEnabled) {
diff --git a/dev/jquery.jtable.header.txt b/dev/jquery.jtable.header.txt index 2b02121..481a5de 100644 --- a/dev/jquery.jtable.header.txt +++ b/dev/jquery.jtable.header.txt @@ -1,6 +1,6 @@ /*
-jTable 2.0.0
+jTable 2.0.1
http://www.jtable.org
---------------------------------------------------------------------------
diff --git a/lib/jquery.jtable.js b/lib/jquery.jtable.js index 7c0c9cd..21fe9fc 100644 --- a/lib/jquery.jtable.js +++ b/lib/jquery.jtable.js @@ -1,6 +1,6 @@ /*
-jTable 2.0.0
+jTable 2.0.1
http://www.jtable.org
---------------------------------------------------------------------------
@@ -454,7 +454,7 @@ THE SOFTWARE. _createCellForRecordField: function (record, fieldName) {
return $('<td></td>')
.addClass(this.options.fields[fieldName].listClass)
- .append((this._getDisplayTextForRecordField(record, fieldName) || ''));
+ .append((this._getDisplayTextForRecordField(record, fieldName)));
},
/* Adds a list of records to the table.
@@ -1508,6 +1508,12 @@ THE SOFTWARE. options.error(data);
return;
}
+
+ if(!data.Record) {
+ self._logError('Server must return the created Record object.');
+ options.error(data);
+ return;
+ }
self._onRecordAdded(data);
@@ -1543,8 +1549,8 @@ THE SOFTWARE. var fieldName = self._fieldList[i];
var field = self.options.fields[fieldName];
- //Do not create input for fields that is key and not specially marked as editable
- if (field.key == true && field.edit != true) {
+ //Do not create input for fields that is key and not specially marked as creatable
+ if (field.key == true && field.create != true) {
continue;
}
@@ -1587,12 +1593,18 @@ THE SOFTWARE. $addRecordForm.attr('action'),
$addRecordForm.serialize(),
function (data) {
- //Check for errors
+
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);
+ return;
+ }
self._onRecordAdded(data);
self._addRow(
@@ -1766,6 +1778,8 @@ THE SOFTWARE. }
$.extend($updatingRow.data('record'), options.record);
+ self._updateRecordValuesFromServerResponse($updatingRow.data('record'), data);
+
self._updateRowTexts($updatingRow);
self._onRecordUpdated($updatingRow, data);
if (options.animationsEnabled) {
diff --git a/lib/jquery.jtable.min.js b/lib/jquery.jtable.min.js index 3ff93af..ae987ae 100644 --- a/lib/jquery.jtable.min.js +++ b/lib/jquery.jtable.min.js @@ -1,5 +1,5 @@ /* -jTable 2.0.0 +jTable 2.0.1 http://www.jtable.org --------------------------------------------------------------------------- Copyright (C) 2011-2012 by Halil brahim Kalkan (http://www.halilibrahimkalkan.com) @@ -33,7 +33,7 @@ c("<div />").addClass("jtable-left-area").appendTo(this._$bottomPanel);c("<div / show:b.options.dialogShowEffect,hide:b.options.dialogHideEffect,modal:!0,title:b.options.messages.error,buttons:[{text:b.options.messages.close,click:function(){b._$errorDialogDiv.dialog("close")}}]})},load:function(b,a){this._lastPostData=b;this._reloadTable(a)},reload:function(b){this._reloadTable(b)},getRowByKey:function(b){for(var a=0;a<this._$tableRows.length;a++)if(b==this._getKeyValueOfRecord(this._$tableRows[a].data("record")))return this._$tableRows[a];return null},destroy:function(){this.element.empty(); c.Widget.prototype.destroy.call(this)},_reloadTable:function(b){var a=this;a._showBusy(a.options.messages.loadingMessage,a.options.loadingAnimationDelay);var c=a._createRecordLoadUrl();a._onLoadingRecords();a._ajax({url:c,data:a._lastPostData,success:function(d){a._hideBusy();"OK"!=d.Result?a._showError(d.Message):(a._removeAllRows("reloading"),a._addRecordsToTable(d.Records),a._onRecordsLoaded(d),b&&b())},error:function(){a._hideBusy();a._showError(a.options.messages.serverCommunicationError)}})}, _createRecordLoadUrl:function(){return this.options.actions.listAction},_createRowFromRecord:function(b){b=c("<tr></tr>").addClass("jtable-data-row").attr("data-record-key",this._getKeyValueOfRecord(b)).data("record",b);this._addCellsToRowUsingRecord(b);return b},_addCellsToRowUsingRecord:function(b){for(var a=b.data("record"),c=0;c<this._columnList.length;c++)this._createCellForRecordField(a,this._columnList[c]).appendTo(b)},_createCellForRecordField:function(b,a){return c("<td></td>").addClass(this.options.fields[a].listClass).append(this._getDisplayTextForRecordField(b, -a)||"")},_addRecordsToTable:function(b){var a=this;c.each(b,function(b,d){a._addRow(a._createRowFromRecord(d))});a._refreshRowStyles()},_addRowToTable:function(b,a,c,d){a={index:this._normalizeNumber(a,0,this._$tableRows.length,this._$tableRows.length)};!0==c&&(a.isNewRow=!0);!1==d&&(a.animationsEnabled=!1);this._addRow(b,a)},_addRow:function(b,a){a=c.extend({index:this._$tableRows.length,isNewRow:!1,animationsEnabled:!0},a);0>=this._$tableRows.length&&this._removeNoDataRow();a.index=this._normalizeNumber(a.index, +a))},_addRecordsToTable:function(b){var a=this;c.each(b,function(b,d){a._addRow(a._createRowFromRecord(d))});a._refreshRowStyles()},_addRowToTable:function(b,a,c,d){a={index:this._normalizeNumber(a,0,this._$tableRows.length,this._$tableRows.length)};!0==c&&(a.isNewRow=!0);!1==d&&(a.animationsEnabled=!1);this._addRow(b,a)},_addRow:function(b,a){a=c.extend({index:this._$tableRows.length,isNewRow:!1,animationsEnabled:!0},a);0>=this._$tableRows.length&&this._removeNoDataRow();a.index=this._normalizeNumber(a.index, 0,this._$tableRows.length,this._$tableRows.length);a.index==this._$tableRows.length?(this._$tableBody.append(b),this._$tableRows.push(b)):0==a.index?(this._$tableBody.prepend(b),this._$tableRows.unshift(b)):(this._$tableRows[a.index-1].after(b),this._$tableRows.splice(a.index,0,b));this._onRowInserted(b,a.isNewRow);a.isNewRow&&(this._refreshRowStyles(),this.options.animationsEnabled&&a.animationsEnabled&&this._showNewRowAnimation(b))},_showNewRowAnimation:function(b){b.addClass("jtable-row-created", "slow","",function(){b.removeClass("jtable-row-created",5E3)})},_removeRowsFromTable:function(b,a){var f=this;0>=b.length||(b.remove(),b.each(function(){f._$tableRows.splice(f._findRowIndex(c(this)),1)}),f._onRowsRemoved(b,a),0==f._$tableRows.length&&f._addNoDataRow(),f._refreshRowStyles())},_findRowIndex:function(b){return this._findIndexInArray(b,this._$tableRows,function(a,b){return a.data("record")==b.data("record")})},_removeAllRows:function(b){if(!(0>=this._$tableRows.length)){var a=this._$tableBody.find("tr.jtable-data-row"); this._$tableBody.empty();this._$tableRows=[];this._onRowsRemoved(a,b);this._addNoDataRow()}},_addNoDataRow:function(){var b=c("<tr></tr>").addClass("jtable-no-data-row").appendTo(this._$tableBody),a=this._$table.find("thead th").length;c("<td></td>").attr("colspan",a).html(this.options.messages.noDataAvailable).appendTo(b)},_removeNoDataRow:function(){this._$tableBody.find(".jtable-no-data-row").remove()},_refreshRowStyles:function(){for(var b=0;b<this._$tableRows.length;b++)0==b%2?this._$tableRows[b].addClass("jtable-row-even"): @@ -59,16 +59,17 @@ c.attr("disabled","disabled").addClass("ui-state-disabled"),f&&c.find("span").te (function(c){var b=c.hik.jtable.prototype._create;c.extend(!0,c.hik.jtable.prototype,{options:{recordAdded:function(){},messages:{addNewRecord:"+ Add new record"}},_$addRecordDiv:null,_create:function(){b.apply(this,arguments);this._createAddRecordDialogDiv()},_createAddRecordDialogDiv:function(){var a=this;a.options.actions.createAction&&(a._$addRecordDiv=c("<div />").appendTo(a._$mainContainer),a._$addRecordDiv.dialog({autoOpen:!1,show:a.options.dialogShowEffect,hide:a.options.dialogHideEffect, width:"auto",minWidth:"300",modal:!0,title:a.options.messages.addNewRecord,buttons:[{text:a.options.messages.cancel,click:function(){a._$addRecordDiv.dialog("close")}},{id:"AddRecordDialogSaveButton",text:a.options.messages.save,click:function(){var b=c("#AddRecordDialogSaveButton"),d=a._$addRecordDiv.find("form");!1!=a._trigger("formSubmitting",null,{form:d,formType:"create"})&&(a._setEnabledOfDialogButton(b,!1,a.options.messages.saving),a._saveAddRecordForm(d,b))}}],close:function(){var b=a._$addRecordDiv.find("form").first(), d=c("#AddRecordDialogSaveButton");a._trigger("formClosed",null,{form:b,formType:"create"});a._setEnabledOfDialogButton(d,!0,a.options.messages.save);b.remove()}}),a.options.addRecordButton||(a.options.addRecordButton=a._createAddRecordButton()),a.options.addRecordButton.click(function(c){c.preventDefault();a._showAddRecordForm()}))},_createAddRecordButton:function(){var a=c("<a></a>").attr("href","#").html(this.options.messages.addNewRecord);return c("<span></span>").addClass("jtable-add-record").append(a).appendTo(this._$bottomPanel.find(".jtable-right-area"))}, -showCreateForm:function(){this._showAddRecordForm()},addRecord:function(a){var b=this;a=c.extend({clientOnly:!1,animationsEnabled:b.options.animationsEnabled,url:b.options.actions.createAction,success:function(){},error:function(){}},a);a.record?a.clientOnly?(b._addRow(b._createRowFromRecord(a.record),{isNewRow:!0,animationsEnabled:a.animationsEnabled}),a.success()):b._submitFormUsingAjax(a.url,c.param(a.record),function(d){"OK"!=d.Result?(b._showError(d.Message),a.error(d)):(b._onRecordAdded(d), -b._addRow(b._createRowFromRecord(d.Record),{isNewRow:!0,animationsEnabled:a.animationsEnabled}),a.success(d))},function(){b._showError(b.options.messages.serverCommunicationError);a.error()}):b._logWarn("options parameter in addRecord method must contain a record property.")},_showAddRecordForm:function(){for(var a=c('<form id="jtable-create-form" class="jtable-dialog-form jtable-create-form" action="'+this.options.actions.createAction+'" method="POST"></form>'),b=0;b<this._fieldList.length;b++){var d= -this._fieldList[b],j=this.options.fields[d];!(!0==j.key&&!0!=j.edit)&&!1!=j.create&&("hidden"==j.type?a.append(this._createInputForHidden(d,j.defaultValue)):(j=c("<div />").addClass("jtable-input-field-container").appendTo(a),j.append(this._createInputLabelForRecordField(d)),j.append(this._createInputForRecordField(d))))}this._$addRecordDiv.append(a).dialog("open");this._trigger("formCreated",null,{form:a,formType:"create"})},_saveAddRecordForm:function(a,b){var d=this;a.data("submitting",!0);d._submitFormUsingAjax(a.attr("action"), -a.serialize(),function(a){"OK"!=a.Result?(d._showError(a.Message),d._setEnabledOfDialogButton(b,!0,d.options.messages.save)):(d._onRecordAdded(a),d._addRow(d._createRowFromRecord(a.Record),{isNewRow:!0}),d._$addRecordDiv.dialog("close"))},function(){d._showError(d.options.messages.serverCommunicationError);d._setEnabledOfDialogButton(b,!0,d.options.messages.save)})},_onRecordAdded:function(a){this._trigger("recordAdded",null,{record:a.Record,serverResponse:a})}})})(jQuery); +showCreateForm:function(){this._showAddRecordForm()},addRecord:function(a){var b=this;a=c.extend({clientOnly:!1,animationsEnabled:b.options.animationsEnabled,url:b.options.actions.createAction,success:function(){},error:function(){}},a);a.record?a.clientOnly?(b._addRow(b._createRowFromRecord(a.record),{isNewRow:!0,animationsEnabled:a.animationsEnabled}),a.success()):b._submitFormUsingAjax(a.url,c.param(a.record),function(d){"OK"!=d.Result?(b._showError(d.Message),a.error(d)):d.Record?(b._onRecordAdded(d), +b._addRow(b._createRowFromRecord(d.Record),{isNewRow:!0,animationsEnabled:a.animationsEnabled}),a.success(d)):(b._logError("Server must return the created Record object."),a.error(d))},function(){b._showError(b.options.messages.serverCommunicationError);a.error()}):b._logWarn("options parameter in addRecord method must contain a record property.")},_showAddRecordForm:function(){for(var a=c('<form id="jtable-create-form" class="jtable-dialog-form jtable-create-form" action="'+this.options.actions.createAction+ +'" method="POST"></form>'),b=0;b<this._fieldList.length;b++){var d=this._fieldList[b],j=this.options.fields[d];!(!0==j.key&&!0!=j.create)&&!1!=j.create&&("hidden"==j.type?a.append(this._createInputForHidden(d,j.defaultValue)):(j=c("<div />").addClass("jtable-input-field-container").appendTo(a),j.append(this._createInputLabelForRecordField(d)),j.append(this._createInputForRecordField(d))))}this._$addRecordDiv.append(a).dialog("open");this._trigger("formCreated",null,{form:a,formType:"create"})},_saveAddRecordForm:function(a, +b){var d=this;a.data("submitting",!0);d._submitFormUsingAjax(a.attr("action"),a.serialize(),function(a){"OK"!=a.Result?(d._showError(a.Message),d._setEnabledOfDialogButton(b,!0,d.options.messages.save)):a.Record?(d._onRecordAdded(a),d._addRow(d._createRowFromRecord(a.Record),{isNewRow:!0}),d._$addRecordDiv.dialog("close")):(d._logError("Server must return the created Record object."),d._setEnabledOfDialogButton(b,!0,d.options.messages.save))},function(){d._showError(d.options.messages.serverCommunicationError); +d._setEnabledOfDialogButton(b,!0,d.options.messages.save)})},_onRecordAdded:function(a){this._trigger("recordAdded",null,{record:a.Record,serverResponse:a})}})})(jQuery); (function(c){var b=c.hik.jtable.prototype._create,a=c.hik.jtable.prototype._addColumnsToHeaderRow,f=c.hik.jtable.prototype._addCellsToRowUsingRecord;c.extend(!0,c.hik.jtable.prototype,{options:{recordUpdated:function(){},rowUpdated:function(){},messages:{editRecord:"Edit Record"}},_$editDiv:null,_$editingRow:null,_create:function(){b.apply(this,arguments);this._createEditDialogDiv()},_createEditDialogDiv:function(){var a=this;a._$editDiv=c("<div></div>").appendTo(a._$mainContainer);a._$editDiv.dialog({autoOpen:!1, show:a.options.dialogShowEffect,hide:a.options.dialogHideEffect,width:"auto",minWidth:"300",modal:!0,title:a.options.messages.editRecord,buttons:[{text:a.options.messages.cancel,click:function(){a._$editDiv.dialog("close")}},{id:"EditDialogSaveButton",text:a.options.messages.save,click:function(){var b=a._$editDiv.find("#EditDialogSaveButton"),c=a._$editDiv.find("form");!1!=a._trigger("formSubmitting",null,{form:c,formType:"edit"})&&(a._setEnabledOfDialogButton(b,!1,a.options.messages.saving),a._saveEditForm(c, b))}}],close:function(){var b=a._$editDiv.find("form:first"),e=c("#EditDialogSaveButton");a._trigger("formClosed",null,{form:b,formType:"edit"});a._setEnabledOfDialogButton(e,!0,a.options.messages.save);b.remove()}})},updateRecord:function(a){var b=this;a=c.extend({clientOnly:!1,animationsEnabled:b.options.animationsEnabled,url:b.options.actions.updateAction,success:function(){},error:function(){}},a);if(a.record){var e=b._getKeyValueOfRecord(a.record);if(void 0==e||null==e)b._logWarn("options parameter in updateRecord method must contain a record that contains the key field property."); -else{var g=b.getRowByKey(e);null==g?b._logWarn("Can not found any row by key: "+e):a.clientOnly?(c.extend(g.data("record"),a.record),b._updateRowTexts(g),b._onRecordUpdated(g,null),a.animationsEnabled&&b._showUpdateAnimationForRow(g),a.success()):b._submitFormUsingAjax(a.url,c.param(a.record),function(e){"OK"!=e.Result?(b._showError(e.Message),a.error(e)):(c.extend(g.data("record"),a.record),b._updateRowTexts(g),b._onRecordUpdated(g,e),a.animationsEnabled&&b._showUpdateAnimationForRow(g),a.success(e))}, -function(){b._showError(b.options.messages.serverCommunicationError);a.error()})}}else b._logWarn("options parameter in updateRecord method must contain a record property.")},_addColumnsToHeaderRow:function(b){a.apply(this,arguments);void 0!=this.options.actions.updateAction&&b.append(this._createEmptyCommandHeader())},_addCellsToRowUsingRecord:function(a){var b=this;f.apply(this,arguments);if(void 0!=b.options.actions.updateAction){var e=c("<span></span>").html(b.options.messages.editRecord),e=c('<button title="'+ -b.options.messages.editRecord+'"></button>').addClass("jtable-command-button jtable-edit-command-button").append(e).click(function(c){c.preventDefault();c.stopPropagation();b._showEditForm(a)});c("<td></td>").addClass("jtable-command-column").append(e).appendTo(a)}},_showEditForm:function(a){for(var b=a.data("record"),e=c('<form id="jtable-edit-form" class="jtable-dialog-form jtable-edit-form" action="'+this.options.actions.updateAction+'" method="POST"></form>'),g=0;g<this._fieldList.length;g++){var k= +else{var g=b.getRowByKey(e);null==g?b._logWarn("Can not found any row by key: "+e):a.clientOnly?(c.extend(g.data("record"),a.record),b._updateRowTexts(g),b._onRecordUpdated(g,null),a.animationsEnabled&&b._showUpdateAnimationForRow(g),a.success()):b._submitFormUsingAjax(a.url,c.param(a.record),function(e){"OK"!=e.Result?(b._showError(e.Message),a.error(e)):(c.extend(g.data("record"),a.record),b._updateRecordValuesFromServerResponse(g.data("record"),e),b._updateRowTexts(g),b._onRecordUpdated(g,e),a.animationsEnabled&& +b._showUpdateAnimationForRow(g),a.success(e))},function(){b._showError(b.options.messages.serverCommunicationError);a.error()})}}else b._logWarn("options parameter in updateRecord method must contain a record property.")},_addColumnsToHeaderRow:function(b){a.apply(this,arguments);void 0!=this.options.actions.updateAction&&b.append(this._createEmptyCommandHeader())},_addCellsToRowUsingRecord:function(a){var b=this;f.apply(this,arguments);if(void 0!=b.options.actions.updateAction){var e=c("<span></span>").html(b.options.messages.editRecord), +e=c('<button title="'+b.options.messages.editRecord+'"></button>').addClass("jtable-command-button jtable-edit-command-button").append(e).click(function(c){c.preventDefault();c.stopPropagation();b._showEditForm(a)});c("<td></td>").addClass("jtable-command-column").append(e).appendTo(a)}},_showEditForm:function(a){for(var b=a.data("record"),e=c('<form id="jtable-edit-form" class="jtable-dialog-form jtable-edit-form" action="'+this.options.actions.updateAction+'" method="POST"></form>'),g=0;g<this._fieldList.length;g++){var k= this._fieldList[g],h=this.options.fields[k],f=b[k];if(!0==h.key)if(!0!=h.edit){e.append(this._createInputForHidden(k,f));continue}else e.append(this._createInputForHidden("jtRecordKey",f));!1!=h.edit&&("hidden"==h.type?e.append(this._createInputForHidden(k,f)):(h=c('<div class="jtable-input-field-container"></div>').appendTo(e),h.append(this._createInputLabelForRecordField(k)),f=this._getValueForRecordField(b,k),h.append(this._createInputForRecordField(k,f,b))))}this._$editingRow=a;this._$editDiv.append(e).dialog("open"); this._trigger("formCreated",null,{form:e,formType:"edit",record:b})},_saveEditForm:function(a,b){var c=this;c._submitFormUsingAjax(a.attr("action"),a.serialize(),function(g){if("OK"!=g.Result)c._showError(g.Message),c._setEnabledOfDialogButton(b,!0,c.options.messages.save);else{var k=c._$editingRow.data("record");c._updateRecordValuesFromEditForm(k,a);c._updateRecordValuesFromServerResponse(k,g);c._updateRowTexts(c._$editingRow);c._$editingRow.attr("data-record-key",c._getKeyValueOfRecord(k));c._onRecordUpdated(c._$editingRow, g);c.options.animationsEnabled&&c._showUpdateAnimationForRow(c._$editingRow);c._$editDiv.dialog("close")}},function(){c._showError(c.options.messages.serverCommunicationError);c._setEnabledOfDialogButton(b,!0,c.options.messages.save)})},_updateRecordValuesFromEditForm:function(a,b){for(var e=0;e<this._fieldList.length;e++){var g=this._fieldList[e],k=this.options.fields[g];if(!1!=k.edit){var h=b.find('[name="'+g+'"]');if("date"==k.type){k=k.displayFormat||this.options.defaultDateFormat;try{var f=c.datepicker.parseDate(k, diff --git a/lib/localization/jquery.jtable.es.js b/lib/localization/jquery.jtable.es.js new file mode 100644 index 0000000..9ea9949 --- /dev/null +++ b/lib/localization/jquery.jtable.es.js @@ -0,0 +1,28 @@ +/*
+ jTable localization file for 'Spanish' language.
+ Author: Guillermo Bisheimer
+*/
+(function ($) {
+
+ $.extend(true, $.hik.jtable.prototype.options.messages, {
+ serverCommunicationError: 'Ocurrió un error en la comunicación con el servidor.',
+ loadingMessage: 'Cargando registros...',
+ noDataAvailable: 'No hay datos disponibles!',
+ addNewRecord: '+ Crear nuevo registro',
+ editRecord: 'Editar registro',
+ areYouSure: '¿Está seguro?',
+ deleteConfirmation: 'El registro será eliminado. ¿Está seguro?',
+ save: 'Guardar',
+ saving: 'Guardando',
+ cancel: 'Cancelar',
+ deleteText: 'Eliminar',
+ deleting: 'Eliminando',
+ error: 'Error',
+ close: 'Cerrar',
+ cannotLoadOptionsFor: 'No se pueden cargar las opciones para el campo {0}',
+ pagingInfo: 'Mostrando registros {0} a {1} de {2}',
+ canNotDeletedRecords: 'No se puede borrar registro(s) {0} de {1}!',
+ deleteProggress: 'Eliminando {0} de {1} registros, procesando...'
+ });
+
+})(jQuery);
\ No newline at end of file diff --git a/lib/localization/jquery.jtable.vi.js b/lib/localization/jquery.jtable.vi.js new file mode 100644 index 0000000..505841c --- /dev/null +++ b/lib/localization/jquery.jtable.vi.js @@ -0,0 +1,26 @@ +/*
+jTable localization file for 'Vietnamese' language.
+Author: Lê Hoàng Hiếu
+*/
+(function ($) {
+ $.extend(true, $.hik.jtable.prototype.options.messages, {
+ serverCommunicationError: 'Có Lỗi Khi Giao Tiếp Với Máy Chủ.',
+ loadingMessage: 'Đang Tải Dữ Liệu...',
+ noDataAvailable: 'Không Có Dữ Liệu!',
+ addNewRecord: '+ Thêm Dữ Liệu',
+ editRecord: 'Chỉnh Sửa',
+ areYouSure: 'Bạn Có Chắc Không?',
+ deleteConfirmation: 'Dữ Liệu Này Sẽ Bị Xóa, Bạn Có Chắc Không?',
+ save: 'Lưu',
+ saving: 'Đang Lưu',
+ cancel: 'Hủy',
+ deleteText: 'Xóa',
+ deleting: 'Đang Xóa',
+ error: 'Lỗi',
+ close: 'Đóng',
+ cannotLoadOptionsFor: 'Không Thể Tải Các Tùy Chọn Cho field {0}!',
+ pagingInfo: 'Hiện từ {0} Đến {1} Của {2} Records',
+ canNotDeletedRecords: 'Không thể xóa {0} Records của {1} Records!',
+ deleteProggress: 'Đã Xóa Được {0} Của {1} Records, Đang Xử Lý...'
+ });
+})(jQuery);
\ No newline at end of file |