Thursday 7 August 2014

Bootstrap Combobox templating issue

Just had to put a Combobox (http://en.wikipedia.org/wiki/Combo_box) on a Bootstrap site.  I've been playing with the bootstrap combobox plug in by Daniel Farrell (http://danielfarrell.com/).

You can find a demo at the github page - https://github.com/danielfarrell/bootstrap-combobox


I was trying to change the template slightly, but no matter what I did it ignored it.

Just found that you need to swap some of the arguments round in the constructor method if you're supplying options on start.

Basically, as seems common sense in hindsight, you need to move the line
this.$container = this.setup();
to be after the template 'option' declaration (which has to be a function returning a string, by the way).


No comments:

Post a Comment