2
0
mirror of https://github.com/frappe/books.git synced 2024-09-20 11:29:00 +00:00

Show items on Link focus (#83)

This commit is contained in:
sahil28297 2018-09-06 13:48:58 +05:30 committed by Faris Ansari
parent 6ada1a8648
commit 4c0e85aaec
3 changed files with 13 additions and 7 deletions

View File

@ -44,4 +44,4 @@ module.exports = class FormModal extends Modal {
}
}
}
}

View File

@ -17,15 +17,23 @@ export default {
methods: {
getInputListeners() {
return {
input: async e => {
this.awesomplete.list = await this.getList(e.target.value);
input: e => {
this.updateList(e.target.value);
},
'awesomplete-select': e => {
const value = e.text.value;
this.handleChange(value);
},
focus: async e => {
await this.updateList();
this.awesomplete.evaluate();
this.awesomplete.open();
}
}
},
async updateList(value) {
this.awesomplete.list = await this.getList(value);
},
getList(text) {
return this.docfield.getList(text);
},
@ -46,11 +54,9 @@ export default {
return li;
}
});
this.bindEvents();
},
bindEvents() {
},
sort() {
// return a function that handles sorting of items

View File

@ -18,9 +18,9 @@ export default {
async getList(query) {
const list = await frappe.db.getAll({
doctype: this.getTarget(),
filters: {
filters: query ? {
keywords: ['like', query]
},
} : null,
fields: ['name'],
limit: 50
});