bootstrap-combobox icon indicating copy to clipboard operation
bootstrap-combobox copied to clipboard

Custom template option doesn't work

Open shatran opened this issue 11 years ago • 2 comments
trafficstars

According to the Docs, it is possible to add a custom template function that returns markup for the combobox, by including it in an object containing template attribute. This option doesn't work.

shatran avatar Sep 09 '14 16:09 shatran

This is still happening.

var Combobox = function ( element, options ) {
  this.options = $.extend({}, $.fn.combobox.defaults, options);
  this.$source = $(element);
  this.$container = this.setup();
  this.$element = this.$container.find('input[type=text]');
  this.$target = this.$container.find('input[type=hidden]');
  this.$button = this.$container.find('.dropdown-toggle');
  this.$menu = $(this.options.menu).appendTo('body');
  this.template = this.options.template || this.template
  this.matcher = this.options.matcher || this.matcher;
  this.sorter = this.options.sorter || this.sorter;
  this.highlighter = this.options.highlighter || this.highlighter;
  this.shown = false;
  this.selected = false;
  this.refresh();
  this.transferAttributes();
  this.listen();
};

this.template initialization should happen before this.setup() is fired.

mort4l-zz avatar Aug 04 '15 11:08 mort4l-zz

I suggest this solution here but i don't know if someone took card of merging it.

shatran avatar Aug 04 '15 12:08 shatran