Pass item as a parameter to onChangeListener

Vitaliy Filippov 2014-09-04 15:18:55 +00:00
parent 2c39146394
commit f140faedb9
2 changed files with 3 additions and 3 deletions

View File

@ -42,7 +42,7 @@
If you don't want to touch the input value, but want to use multi-select for
your own purposes, specify a callback that will handle item clicks here.
Also you can disable and check/uncheck items during loading in this mode.
onChangeListener(hint, index)
onChangeListener(hint, index, item)
Callback which is called when input value is changed using this dropdown.
index is the number of element which selection is changed, starting with 0.
It must be used instead of normal 'onchange' event.
@ -332,7 +332,7 @@ SimpleAutocomplete.prototype.selectItem = function(index)
this.curValue = this.input.value;
if (this.onChangeListener)
this.onChangeListener(this, index);
this.onChangeListener(this, index, this.items[index]);
// Change input value so it will respect index'th item state in a multi-select

hinter.min.js vendored

File diff suppressed because one or more lines are too long