bootstrap-combobox
bootstrap-combobox copied to clipboard
Custom template option doesn't work
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.
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.
I suggest this solution here but i don't know if someone took card of merging it.