Files
x-editable/src/editable-form/editable-form-jqueryui.js
2012-11-14 22:44:18 +04:00

32 lines
1.0 KiB
JavaScript

/*
Editableform based on jQuery UI
*/
(function ($) {
$.extend($.fn.editableform.Constructor.prototype, {
initTemplate: function() {
this.$form = $($.fn.editableform.template);
//init buttons
this.$form.find('button[type=submit]').button({
icons: { primary: "ui-icon-check" },
text: false
});
this.$form.find('button[type=button]').button({
icons: { primary: "ui-icon-cancel" },
text: false
});
}
});
//form template
$.fn.editableform.template = '<form class="editableform"><div class="control-group">' +
'&nbsp;<button type="submit" style="height: 24px">submit</button>&nbsp;<button type="button" style="height: 24px">cancel</button></div>' +
'<div class="editable-error-block"></div>' +
'</form>';
//error classes
$.fn.editableform.errorGroupClass = null;
$.fn.editableform.errorBlockClass = 'ui-state-error';
}(window.jQuery));