Knockout.js links btn-group bootstrap

I am wondering if it is possible to associate the selected value in the loading block of the Twitter btn group with the observable in knockout.js?

In my case, I bind the group to the observable array like this

  <div class="btn-group" data-toggle="buttons-radio" data-bind="foreach: myItemTypes">
    <button class="btn active" data-bind="html: Value, Id: Key">${ Description }</button>
  </div>

Any directions?

Greetings

Fergal

+5
source share
2 answers

Here is an example of how this can be done:

http://jsfiddle.net/jearles/vu8pk/

Using css binding, we can dynamically turn on / off the “active” class based on the selected observable for each button.

+11
source
+7
source

All Articles