我试图使用bootstrap的漂亮风格
button dropdowns与淘汰赛.不幸的是,下拉列表是使用链接而不是< select>构建的.和knockout-bootstrap没有任何帮助的处理程序.
我已经能够使所有的样式工作(按钮类型,图标,选择/取消选择).但是,我仍然无法使点击功能起作用:
<div class="btn-group"> <!-- Change button type based on status --> <button type="button" class="btn btn-small dropdown-toggle" data-bind="css: {'btn-default' : status().statusName=='Matched','btn-danger' : status().statusName=='None','btn-info' : status().statusName=='Set'}" data-toggle="dropdown"> <!-- Add Glyph based on status --> <span class="glyphicon" data-bind="css: {'glyphicon-ok' : status().statusName=='Matched','glyphicon-remove' : status().statusName=='None','glyphicon-list' : status().statusName=='Set'}"></span> <span data-bind="text: status().statusName"> </span> <span class="caret"></span> </button> <!-- Loop for status --> <ul class="dropdown-menu" role="menu" data-bind="foreach: $root.availableStatus"> <!-- disable item if selected --> <li data-bind="css: {'disabled' : statusName==$parent.status().statusName}"> <!-- Not working --> <a href="#" data-bind="click: $root.updateStatus"><span class="glyphicon" data-bind="css: {'glyphicon-ok' : statusName=='Matched','glyphicon-remove' : statusName=='None','glyphicon-list' : statusName=='Set'}"></span> <span data-bind="text: statusName"></span></a>]