callbackDropdownInit: null,
callbackSelect: null,
delay: 500,
+ excludedSearchValues: [],
minLength: 3,
noResultPlaceholder: '',
preventSubmit: false
this._element.addEventListener('keyup', this._keyup.bind(this));
},
+ /**
+ * Adds an excluded search value.
+ *
+ * @param {string} value excluded value
+ */
+ addExcludedSearchValues: function (value) {
+ if (this._options.excludedSearchValues.indexOf(value) === -1) {
+ this._options.excludedSearchValues.push(value);
+ }
+ },
+
+ /**
+ * Removes a value from the excluded search values.
+ *
+ * @param {string} value excluded value
+ */
+ removeExcludedSearchValues: function (value) {
+ var index = this._options.excludedSearchValues.indexOf(value);
+ if (index !== -1) {
+ this._options.excludedSearchValues.splice(index, 1);
+ }
+ },
+
/**
* Handles the 'keydown' event.
*
return {
parameters: {
data: {
+ excludedSearchValues: this._options.excludedSearchValues,
searchString: value
}
}