mirror of
https://gitlab.easter-eggs.com/ee/ldapsaisie.git
synced 2024-11-22 18:09:06 +01:00
supannCompositeAttribute: fix clearing value
This commit is contained in:
parent
6e98cfef20
commit
3c02b94085
4 changed files with 231 additions and 219 deletions
|
@ -19,11 +19,10 @@ var LSformElement_supannCompositeAttribute_field = new Class({
|
|||
},
|
||||
|
||||
clearValue: function() {
|
||||
console.log('clear');
|
||||
console.log(this.values);
|
||||
if (this.values.length>1) {
|
||||
for(var i=1; i<=this.values.length; i++) {
|
||||
$(this.values[i].li).dispose();
|
||||
delete this.values[i];
|
||||
}
|
||||
this.values[0].clear();
|
||||
}
|
||||
|
|
|
@ -4,12 +4,19 @@ var LSformElement_supannCompositeAttribute_field_value_component = new Class({
|
|||
this.field_name = field_name;
|
||||
this.name = name;
|
||||
this.params = varLSdefault.LSjsConfig[this.field_name];
|
||||
this.cconf = this.params.components[this.name];
|
||||
|
||||
if (this.cconf.type == 'select') {
|
||||
this.select = p.getElement('select');
|
||||
}
|
||||
else if (['date', 'text'].includes(this.cconf.type)) {
|
||||
this.input = p.getElement('input');
|
||||
}
|
||||
else if (['table', 'codeEntite', 'parrainDN'].includes(this.cconf.type)) {
|
||||
this.input = p.getElement('input');
|
||||
this.img = p.getElement('img');
|
||||
this.span = p.getElement('span');
|
||||
|
||||
if (['table', 'codeEntite', 'parrainDN'].includes(this.params.components[this.name].type)) {
|
||||
this.inputSearch=new Element(
|
||||
'input',
|
||||
{
|
||||
|
@ -97,7 +104,6 @@ var LSformElement_supannCompositeAttribute_field_value_component = new Class({
|
|||
this._possibleValues.injectInside(this.p);
|
||||
}
|
||||
|
||||
|
||||
var ul=new Element('ul');
|
||||
possibleValues.each(function(v) {
|
||||
var li=new Element(
|
||||
|
@ -161,13 +167,20 @@ var LSformElement_supannCompositeAttribute_field_value_component = new Class({
|
|||
},
|
||||
|
||||
clear: function() {
|
||||
if (this.cconf.type == 'select') {
|
||||
this.select.set('value', '');
|
||||
}
|
||||
else if (['date', 'text'].includes(this.cconf.type)) {
|
||||
this.input.set('value', '');
|
||||
}
|
||||
else if (['table', 'codeEntite', 'parrainDN'].includes(this.cconf.type)) {
|
||||
this.input.set('value', '');
|
||||
if (this.img) {
|
||||
this.img.dispose();
|
||||
this.img=null;
|
||||
}
|
||||
this.input.set('value','');
|
||||
if (this.span) {
|
||||
this.span.set('html',this.params.noValueLabel);
|
||||
this.span.set('html', this.params.noValueLabel);
|
||||
this.span.set('title', '');
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue