comments for docs
This commit is contained in:
src
@ -367,7 +367,7 @@ Editableform is linked with one of input types, e.g. 'text', 'select' etc.
|
|||||||
url: function(params) {
|
url: function(params) {
|
||||||
if(params.value === 'abc') {
|
if(params.value === 'abc') {
|
||||||
var d = new $.Deferred;
|
var d = new $.Deferred;
|
||||||
return d.reject('field cannot be "abc"'); //returning error via deferred object
|
return d.reject('error message'); //returning error via deferred object
|
||||||
} else {
|
} else {
|
||||||
someModel.set(params.name, params.value); //save data in some js model
|
someModel.set(params.name, params.value); //save data in some js model
|
||||||
}
|
}
|
||||||
@ -458,21 +458,21 @@ Editableform is linked with one of input types, e.g. 'text', 'select' etc.
|
|||||||
/**
|
/**
|
||||||
Additional options for ajax request.
|
Additional options for ajax request.
|
||||||
List of values: http://api.jquery.com/jQuery.ajax
|
List of values: http://api.jquery.com/jQuery.ajax
|
||||||
|
|
||||||
@property ajaxOptions
|
@property ajaxOptions
|
||||||
@type object
|
@type object
|
||||||
@default null
|
@default null
|
||||||
@since 1.1.1
|
@since 1.1.1
|
||||||
|
@example
|
||||||
|
ajaxOptions: {
|
||||||
|
type: 'put',
|
||||||
|
dataType: 'json'
|
||||||
|
}
|
||||||
**/
|
**/
|
||||||
ajaxOptions: null,
|
ajaxOptions: null,
|
||||||
/**
|
/**
|
||||||
Whether to show buttons or not.
|
Whether to show buttons or not.
|
||||||
Form without buttons can be auto-submitted by input or by onblur = 'submit'.
|
Form without buttons is auto-submitted.
|
||||||
@example
|
|
||||||
ajaxOptions: {
|
|
||||||
method: 'PUT',
|
|
||||||
dataType: 'xml'
|
|
||||||
}
|
|
||||||
|
|
||||||
@property showbuttons
|
@property showbuttons
|
||||||
@type boolean
|
@type boolean
|
||||||
|
@ -96,8 +96,12 @@ Makes editable any HTML element on the page. Applied as jQuery method.
|
|||||||
|
|
||||||
@event init
|
@event init
|
||||||
@param {Object} event event object
|
@param {Object} event event object
|
||||||
@param {Object} editable editable instance
|
@param {Object} editable editable instance (as here it cannot accessed via data('editable'))
|
||||||
@since 1.2.0
|
@since 1.2.0
|
||||||
|
@example
|
||||||
|
$('#username').on('init', function(e, editable) {
|
||||||
|
alert('initialized ' + editable.options.name);
|
||||||
|
});
|
||||||
**/
|
**/
|
||||||
this.$element.triggerHandler('init', this);
|
this.$element.triggerHandler('init', this);
|
||||||
}, this));
|
}, this));
|
||||||
@ -307,13 +311,7 @@ Makes editable any HTML element on the page. Applied as jQuery method.
|
|||||||
@param {Object} params.response ajax response
|
@param {Object} params.response ajax response
|
||||||
@example
|
@example
|
||||||
$('#username').on('save', function(e, params) {
|
$('#username').on('save', function(e, params) {
|
||||||
//assuming server response: '{success: true}'
|
alert('Saved value: ' + params.newValue);
|
||||||
var pk = $(this).data('editable').options.pk;
|
|
||||||
if(params.response && params.response.success) {
|
|
||||||
alert('value: ' + params.newValue + ' with pk: ' + pk + ' saved!');
|
|
||||||
} else {
|
|
||||||
alert('error!');
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
**/
|
**/
|
||||||
//event itself is triggered by editableContainer. Description here is only for documentation
|
//event itself is triggered by editableContainer. Description here is only for documentation
|
||||||
@ -540,7 +538,7 @@ Makes editable any HTML element on the page. Applied as jQuery method.
|
|||||||
**/
|
**/
|
||||||
autotext: 'auto',
|
autotext: 'auto',
|
||||||
/**
|
/**
|
||||||
Initial value of input. Taken from <code>data-value</code> or element's text.
|
Initial value of input. If not set, taken from element's text.
|
||||||
|
|
||||||
@property value
|
@property value
|
||||||
@type mixed
|
@type mixed
|
||||||
@ -550,7 +548,7 @@ Makes editable any HTML element on the page. Applied as jQuery method.
|
|||||||
/**
|
/**
|
||||||
Callback to perform custom displaying of value in element's text.
|
Callback to perform custom displaying of value in element's text.
|
||||||
If <code>null</code>, default input's value2html() will be called.
|
If <code>null</code>, default input's value2html() will be called.
|
||||||
If <code>false</code>, no displaying methods will be called, element's text will no change.
|
If <code>false</code>, no displaying methods will be called, element's text will never change.
|
||||||
Runs under element's scope.
|
Runs under element's scope.
|
||||||
Second parameter __sourceData__ is passed for inputs with source (select, checklist).
|
Second parameter __sourceData__ is passed for inputs with source (select, checklist).
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user