Files
iTop/js/subform_field.js
Romain Quetiez 21f0adb41b Prerequisites for custom fields
SVN:trunk[3913]
2016-02-19 08:49:14 +00:00

47 lines
1.1 KiB
JavaScript

//iTop Form field
;
$(function()
{
// the widget definition, where 'itop' is the namespace,
// 'subform_field' the widget name
$.widget( 'itop.subform_field', $.itop.form_field,
{
// default options
options:
{
field_set: null
},
// the constructor
_create: function()
{
var me = this;
this.element
.addClass('subform_field');
this._super();
},
// events bound via _bind are removed automatically
// revert other modifications here
_destroy: function()
{
this.element
.removeClass('subform_field');
this._super();
},
getCurrentValue: function()
{
return this.options.field_set.triggerHandler('get_current_values');
},
validate: function(event, data)
{
return {
is_valid: this.options.field_set.triggerHandler('validate', data),
error_messages: []
}
},
});
});