2
0
mirror of https://github.com/frappe/books.git synced 2025-01-27 09:08:24 +00:00

25 lines
677 B
JavaScript
Raw Normal View History

2018-01-12 17:55:07 +05:30
const BaseControl = require('./base');
2018-02-08 17:15:32 +05:30
const frappe = require('frappejs');
2018-01-12 17:55:07 +05:30
class SelectControl extends BaseControl {
2018-02-08 17:15:32 +05:30
makeInput() {
this.input = frappe.ui.add('select', 'form-control', this.formGroup);
2018-01-12 17:55:07 +05:30
let options = this.options;
if (typeof options==='string') {
options = options.split('\n');
}
for (let value of options) {
let option = frappe.ui.add('option', null, this.input);
option.textContent = value;
option.setAttribute('value', value);
}
}
make() {
super.make();
this.input.setAttribute('row', '3');
}
};
module.exports = SelectControl;