item passed to updater of typeahead is now the complete element not just the data-value

This commit is contained in:
Uwe Steinmann 2021-03-29 13:47:41 +02:00
parent f29205a558
commit 449db6bd5b

View File

@ -205,7 +205,7 @@ $(document).ready( function() {
* actually provided to update the input field where you type, but here * actually provided to update the input field where you type, but here
* we use it to update a second input field with the doc id. */ * we use it to update a second input field with the doc id. */
updater: function (item) { updater: function (item) {
strarr = item.split("#"); strarr = item.value.split("#");
target = this.$element.data('target'); target = this.$element.data('target');
$('#'+target).attr('value', strarr[0]); $('#'+target).attr('value', strarr[0]);
return strarr[1]; return strarr[1];
@ -233,7 +233,7 @@ $(document).ready( function() {
* actually provided to update the input field, but here we use * actually provided to update the input field, but here we use
* it to set the document location. */ * it to set the document location. */
updater: function (item) { updater: function (item) {
strarr = item.split("#"); strarr = item.value.split("#");
//console.log(this.$element.data('target')); //console.log(this.$element.data('target'));
target = this.$element.data('target'); target = this.$element.data('target');
$('#'+target).attr('value', strarr[0]); $('#'+target).attr('value', strarr[0]);