tems = [
  {
    type: 'A',
    name: 'A Text'
  },
  {
    type: 'B',
    name: 'B Text'
  },
  {
    type: 'D',
    name: 'D Text'
  },
  {
    type: 'C',
    name: 'C Text'
  }
]

var ti = new hx.TagInput('#autocomplete-example', {
  autocompleteOptions: {
    renderer: function (elem, item) {
      hx.select(elem).text(item.name)
    },
    inputMap: function (item) { return item.name }
  },
  autocompleteData: function (term, cb) {
    // Remove duplicates and filter based on search term
    cb(items.f