Add basic autocomplete support for "quick row" feature

This commit is contained in:
Lance Edgar 2018-07-13 19:12:39 -05:00
parent 68bd3047c4
commit 935a6b2a68
4 changed files with 58 additions and 7 deletions

View file

@ -37,6 +37,17 @@ $(document).on('pagecreate', function() {
});
// submit "quick row" form upon autocomplete selection
$(document).on('autocompleteitemselected', function(event, uuid) {
var field = $(event.target);
if (field.hasClass('quick-row')) {
var form = field.parents('form:first');
form.find('[name="quick_row_entry"]').val(uuid);
form.submit();
}
});
/**
* Automatically set focus to certain fields, on various pages
* TODO: this should accept selector params instead of hard-coding..?