HexagonJS
AutoComplete Changelog
2.7.1
hx.AutoCompleteextendsEventEmitter
Deprecated
Replaced by hx.Autocomplete (lowercase c)
hx.autoCompleteSelection
Deprecated
Replaced by hx.autocomplete (lowercase c)
2.7.0
hx.AutoCompleteextendsEventEmitter
Deprecated
Replaced by hx.Autocomplete (lowercase c)
hx.autoCompleteSelection
Deprecated
Replaced by hx.autocomplete (lowercase c)
2.5.3
hx.AutoCompleteextendsEventEmitter
Deprecated
Replaced by hx.Autocomplete (lowercase c)
hx.autoCompleteSelection
Deprecated
Replaced by hx.autocomplete (lowercase c)
2.5.2
hx.AutoCompleteextendsEventEmitter
Deprecated
Replaced by hx.Autocomplete (lowercase c)
hx.autoCompleteSelection
Deprecated
Replaced by hx.autocomplete (lowercase c)
2.5.1
hx.AutoCompleteextendsEventEmitter
Deprecated
Replaced by hx.Autocomplete (lowercase c)
hx.autoCompleteSelection
Deprecated
Replaced by hx.autocomplete (lowercase c)
2.5.0
hx.AutoCompleteextendsEventEmitter
Deprecated
Replaced by hx.Autocomplete (lowercase c)
hx.autoCompleteSelection
Deprecated
Replaced by hx.autocomplete (lowercase c)
2.4.0
hx.AutoCompleteextendsEventEmitter
Deprecated
Replaced by hx.Autocomplete (lowercase c)
hx.autoCompleteSelection
Deprecated
Replaced by hx.autocomplete (lowercase c)
2.3.1
hx.AutoCompleteextendsEventEmitter
Deprecated
Replaced by hx.Autocomplete (lowercase c)
hx.autoCompleteSelection
Deprecated
Replaced by hx.autocomplete (lowercase c)
2.3.0
hx.AutoCompleteextendsEventEmitter
Deprecated
Replaced by hx.Autocomplete (lowercase c)
hx.autoCompleteSelection
Deprecated
Replaced by hx.autocomplete (lowercase c)
2.2.0
hx.AutoCompleteextendsEventEmitter
Deprecated
Replaced by hx.Autocomplete (lowercase c)
hx.autoCompleteSelection
Deprecated
Replaced by hx.autocomplete (lowercase c)
2.1.0
hx.AutoCompleteextendsEventEmitter
Deprecated
Replaced by hx.Autocomplete (lowercase c)
hx.autoCompleteSelection
Deprecated
Replaced by hx.autocomplete (lowercase c)
2.0.3
hx.AutoCompleteextendsEventEmitter
Deprecated
Replaced by hx.Autocomplete (lowercase c)
hx.autoCompleteSelection
Deprecated
Replaced by hx.autocomplete (lowercase c)
2.0.2
hx.AutoCompleteextendsEventEmitter
Deprecated
Replaced by hx.Autocomplete (lowercase c)
hx.autoCompleteSelection
Deprecated
Replaced by hx.autocomplete (lowercase c)
2.0.1
hx.AutoCompleteextendsEventEmitter
Deprecated
Replaced by hx.Autocomplete (lowercase c)
hx.autoCompleteSelection
Deprecated
Replaced by hx.autocomplete (lowercase c)
2.0.0
hx.AutoCompleteextendsEventEmitter
Deprecated
Replaced by hx.Autocomplete (lowercase c)
hx.autoCompleteSelection
Deprecated
Replaced by hx.autocomplete (lowercase c)
hx.AutocompleteextendsEventEmitter
Added
The AutoComplete class can be used to add an auto complete suggestion dropdown to any input field.
hx.autocompleteSelection
Added
Creates a new AutoComplete set up on a detached element, wrapped in a selection
1.17.0
hx.AutoCompleteextendsEventEmitter
Bugfix
#338
Resolved an issue when using async data and mustMatch threw an error and broke the dropdown when pressing enter before the data is returned.
hx.AutoCompleteoptionsObject
options
valueString / Any
Added
#349
Added the ability to set the autocomplete value in the constructor
hx.autoCompleteoptionsObject
options
valueString / Any
Added
#349
Added the ability to set the autocomplete value in the constructor
hx.AutocompleteoptionsObject
options
valueString / Any
Added
#349
Added the ability to set the autocomplete value in the constructor
hx.autocompleteoptionsObject
options
valueString / Any
Added
#349
Added the ability to set the autocomplete value in the constructor
1.10.0
hx.AutoCompleteextendsEventEmitter
Bugfix
#346
Resolved an issue where typing enter quickly before debouncing completes allowed values that didn't match the current filter to be entered
1.8.2
hx.AutoCompleteextendsEventEmitter
Bugfix
#343
Fixed an issue where the filtering failed when there were no 'disabled' items in the list
1.8.0
hx.AutoCompleteextendsEventEmitter
Bugfix
#273
Fixed an issue where object based items were being sorted incorrectly
1.4.2
hx.AutoCompleteextendsEventEmitter
Bugfix
Fixed where the code was using the loadingMessage and pleaseEnterMinCharactersMessage
1.4.0
hx.AutoCompleteoptionsObject
options
noResultsMessageString
Updated
#211
The default text for noResultsMessage is retrieved from the userFacingText module
hx.AutoCompleteoptionsObject
options
pleaseEnterMinCharactersMessageString
Added
The text to display when the user has not entered enough text.
When setting this, the minimum number of characters can be substituted in using the '$minLength' variable, e.g.
options = {
  minLength: 3,
  pleaseEnterMinCharactersMessage = 'Please enter $minLength characters'
}
// Evaluates to 'Please enter 3 characters'
hx.autoCompleteoptionsObject
options
noResultsMessageString
Updated
#211
The default text for noResultsMessage is retrieved from the userFacingText module
hx.autoCompleteoptionsObject
options
pleaseEnterMinCharactersMessageString
Added
The text to display when the user has not entered enough text.
When setting this, the minimum number of characters can be substituted in using the '$minLength' variable, e.g.
options = {
  minLength: 3,
  pleaseEnterMinCharactersMessage = 'Please enter $minLength characters'
}
// Evaluates to 'Please enter 3 characters'
hx.AutocompleteoptionsObject
options
noResultsMessageString
Updated
#211
The default text for noResultsMessage is retrieved from the userFacingText module
hx.AutocompleteoptionsObject
options
pleaseEnterMinCharactersMessageString
Added
The text to display when the user has not entered enough text.
When setting this, the minimum number of characters can be substituted in using the '$minLength' variable, e.g.
options = {
  minLength: 3,
  pleaseEnterMinCharactersMessage = 'Please enter $minLength characters'
}
// Evaluates to 'Please enter 3 characters'
hx.autocompleteoptionsObject
options
noResultsMessageString
Updated
#211
The default text for noResultsMessage is retrieved from the userFacingText module
hx.autocompleteoptionsObject
options
pleaseEnterMinCharactersMessageString
Added
The text to display when the user has not entered enough text.
When setting this, the minimum number of characters can be substituted in using the '$minLength' variable, e.g.
options = {
  minLength: 3,
  pleaseEnterMinCharactersMessage = 'Please enter $minLength characters'
}
// Evaluates to 'Please enter 3 characters'
1.3.0
hx.autoCompleteitemsArray / Function
Added
The items to use as suggestions for the input field. Data can be specified as an array of items or as a function that returns an array of items.
The data must be in one of the following formats:
Array
[
  "Bob",
  "Steve",
  ...
]
By default, the data is expected as an array of string values. If object based data is passed in, an inputMap must be provided in the options:
data = [
  {
    name "Bob",
    age: 21
  },
  {
    name: "Steve",
    age: 25
  }
]
options = {
  inputMap: function(item){
    return item.name + ', ' + item.age
  }
}
A renderer and filterOptions.searchValues can also be specified to change how the text is displayed and what data is searchable, independent of the inputMap
.
Function
var data = function(term, callback){
  hx.json('path/to/data?search='+term, function (e, r) {
    callback(r.responseText)
  })
}
A 'Loading...' message will be shown whilst the AutoComplete waits for a response from this function.
It can be used in conjunction with the internal matching or be used to match externally when setting the matchType to 'external':
function data (term, callback) {
  if (term.length > 0) {
    return callback(townAndCountyData.filter(function (d) {
      var d = townAndCountyData[_i]
      var name = d.name.toLowerCase()
      var term = term.toLowerCase()
      var county = d.county.toLowerCase()
      return name.indexOf(term) > -1 || county.indexOf(term) > -1)
    }))
  } else {
    return callback([])
  }
}

options.matchType = 'external'
The term passed in is the current value of the input field (for use as a search term).
The callback is the function that should be called to pass the data back to the AutoComplete to display.
The callback must be called for the AutoComplete to show.
1.2.1
hx.AutoCompleteextendsEventEmitter
Bugfix
#172
Fixed a breaking issue with the autocomplete that caused it not to autocomplete and external matchers to break.
1.0.0
hx.autoCompleteSelection
Added
Creates a new AutoComplete set up on a detached element, wrapped in a selection
0.14.0
hx.AutoComplete
hidesuppressEventsBoolean
suppressEventsBoolean
Removed
Suppressing events is now possible with AutoComplete::suppressed(eventName, suppress). This is part of the Event Emitter api.
hx.AutoComplete
hideString
Removed
Use the dropdown.hidestart or dropdown.hideend event instead.
hx.Autocomplete
hidesuppressEventsBoolean
suppressEventsBoolean
Removed
Suppressing events is now possible with AutoComplete::suppressed(eventName, suppress). This is part of the Event Emitter api.
hx.Autocomplete
hideString
Removed
Use the dropdown.hidestart or dropdown.hideend event instead.
0.13.0
hx.AutoComplete
hidesuppressEventsBoolean
suppressEventsBoolean
Deprecated
Suppressing events is now possible with AutoComplete::suppressed(eventName, suppress). This is part of the Event Emitter api.
hx.AutoComplete
valueString
Added
Getting the value of the auto complete.
hx.AutoComplete
Added
Setting the value of the auto complete.
hx.AutoComplete
hideString
Deprecated
Use the dropdown.hidestart or dropdown.hideend event instead.
hx.AutoComplete
highlight
Added
The event emitted when an item is set as the active item. This can only be done by the keyboard or when the user clicks on an item
hx.Autocomplete
hidesuppressEventsBoolean
suppressEventsBoolean
Deprecated
Suppressing events is now possible with AutoComplete::suppressed(eventName, suppress). This is part of the Event Emitter api.
hx.Autocomplete
valueString
Added
Getting the value of the auto complete.
hx.Autocomplete
Added
Setting the value of the auto complete.
hx.Autocomplete
hideString
Deprecated
Use the dropdown.hidestart or dropdown.hideend event instead.
hx.Autocomplete
highlight
Added
The event emitted when an item is set as the active item. This can only be done by the keyboard or when the user clicks on an item
0.10.0
hx.AutoCompleteoptionsObject
options
trimTrailingSpacesBoolean
Added
An option to enable whitespace trimming at the end of the input value if no results are found for that string.
hx.autoCompleteoptionsObject
options
trimTrailingSpacesBoolean
Added
An option to enable whitespace trimming at the end of the input value if no results are found for that string.
hx.AutocompleteoptionsObject
options
trimTrailingSpacesBoolean
Added
An option to enable whitespace trimming at the end of the input value if no results are found for that string.
hx.autocompleteoptionsObject
options
trimTrailingSpacesBoolean
Added
An option to enable whitespace trimming at the end of the input value if no results are found for that string.
0.9.0
hx.AutoCompleteextendsEventEmitter
Added
The AutoComplete class can be used to add an auto complete suggestion dropdown to any input field.