mirror of
https://github.com/frappe/books.git
synced 2024-11-14 01:14:03 +00:00
24 lines
643 B
JavaScript
24 lines
643 B
JavaScript
const BaseControl = require('./base');
|
|
|
|
class SelectControl extends BaseControl {
|
|
make_input() {
|
|
this.input = frappe.ui.add('select', 'form-control', this.form_group);
|
|
|
|
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; |