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 Input from '../../lib/input';
import asignProps from '../../lib/asign-props';
import './style.scss';
/**
@ -214,17 +215,19 @@ export default class Autocomplete extends Input {
staticData: this.data
});
Object.assign(this.$.dropDown, {
valueField: this.valueField,
showField: this.showField,
selectFields: this.getFields(),
where: this.where,
order: this.order,
parent: this.input,
multiple: this.multiple,
limit: this.limit,
$transclude: this.$transclude
});
asignProps(this, this.$.dropDown, [
'valueField',
'showField',
'where',
'order',
'showFilter',
'multiple',
'limit',
'$transclude'
]);
this.$.dropDown.selectFields = this.getFields();
this.$.dropDown.parent = this.input;
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];
}