added submitValue
to save
event params
This commit is contained in:
@ -212,8 +212,11 @@ Editableform is linked with one of input types, e.g. 'text', 'select' etc.
|
||||
return;
|
||||
}
|
||||
|
||||
//convert value for submitting to server
|
||||
var submitValue = this.input.value2submit(newValue);
|
||||
|
||||
//sending data to server
|
||||
$.when(this.save(newValue))
|
||||
$.when(this.save(submitValue))
|
||||
.done($.proxy(function(response) {
|
||||
//run success callback
|
||||
var res = typeof this.options.success === 'function' ? this.options.success.call(this.options.scope, response, newValue) : null;
|
||||
@ -246,7 +249,8 @@ Editableform is linked with one of input types, e.g. 'text', 'select' etc.
|
||||
@event save
|
||||
@param {Object} event event object
|
||||
@param {Object} params additional params
|
||||
@param {mixed} params.newValue submitted value
|
||||
@param {mixed} params.newValue raw new value
|
||||
@param {mixed} params.submitValue submitted value as string
|
||||
@param {Object} params.response ajax response
|
||||
|
||||
@example
|
||||
@ -254,7 +258,7 @@ Editableform is linked with one of input types, e.g. 'text', 'select' etc.
|
||||
if(params.newValue === 'username') {...}
|
||||
});
|
||||
**/
|
||||
this.$div.triggerHandler('save', {newValue: newValue, response: response});
|
||||
this.$div.triggerHandler('save', {newValue: newValue, submitValue: submitValue, response: response});
|
||||
}, this))
|
||||
.fail($.proxy(function(xhr) {
|
||||
var msg;
|
||||
@ -269,10 +273,7 @@ Editableform is linked with one of input types, e.g. 'text', 'select' etc.
|
||||
}, this));
|
||||
},
|
||||
|
||||
save: function(newValue) {
|
||||
//convert value for submitting to server
|
||||
var submitValue = this.input.value2submit(newValue);
|
||||
|
||||
save: function(submitValue) {
|
||||
//try parse composite pk defined as json string in data-pk
|
||||
this.options.pk = $.fn.editableutils.tryParseJson(this.options.pk, true);
|
||||
|
||||
|
Reference in New Issue
Block a user