Refactor autocomplete CR JUAN para Tarea #265

This commit is contained in:
gerard 2018-05-08 09:58:49 +02:00
parent 23c6ab7c39
commit b569247e91
2 changed files with 20 additions and 11 deletions

View File

@ -1,5 +1,6 @@
import ngModule from '../../module'; import ngModule from '../../module';
import Input from '../../lib/input'; import Input from '../../lib/input';
import asignProps from '../../lib/asign-props';
import './style.scss'; import './style.scss';
/** /**
@ -214,17 +215,19 @@ export default class Autocomplete extends Input {
staticData: this.data staticData: this.data
}); });
Object.assign(this.$.dropDown, { asignProps(this, this.$.dropDown, [
valueField: this.valueField, 'valueField',
showField: this.showField, 'showField',
selectFields: this.getFields(), 'where',
where: this.where, 'order',
order: this.order, 'showFilter',
parent: this.input, 'multiple',
multiple: this.multiple, 'limit',
limit: this.limit, '$transclude'
$transclude: this.$transclude ]);
});
this.$.dropDown.selectFields = this.getFields();
this.$.dropDown.parent = this.input;
this.$.dropDown.show(search); this.$.dropDown.show(search);
} }
} }

View File

@ -0,0 +1,6 @@
export default function(srcObject, dstObject, props) {
for (let prop of props)
if (srcObject[prop] !== undefined)
dstObject[prop] = srcObject[prop];
}