0

I am using jQuery Ui to make list items selectable on my web app. Inside each item from this list I have a dropdown button. When I'm adding the selectable option to the list, the dropdown options doesn't open since the item (the button's parent) is being selected, and the button is not clickable anymore, as if the selectable option "hides" the clickability of the button. How can i fix it? My code looks like this:

<ul ui-selectable>
<li data-ng-repeat="item in items | filter:filterText">
   <div type="button" class="dropdown " >
       <a class="dropdown-toggle " id="dLabel" role="button" data-toggle= "dropdown" data-target="#" ng-href="/page.html">aaa
       </a>
       <ul class=" dropdown-menu " role="menu" >
           <li > ng-href="#" >blabla1</a></li>
           <li > ng-href="#" >blabla2</a></li>
           <li > ng-href="#" >blabla3</a></li>

       </ul>
    </div>
</li>

4

1 回答 1

0

首先,您的代码缺少一些部分。请参阅下面的评论。

我拿走了你的东西并清理了它:

<ul ui-selectable>
<li data-ng-repeat="item in items | filter:filterText">
    <div type="button" class="dropdown "> <a class="dropdown-toggle " id="dLabel" role="button" data-toggle="dropdown" data-target="#" ng-href="/page.html">aaa
   </a>

        <ul class=" dropdown-menu " role="menu">
            <!-- You were missing the <a in front of each ng-href -->
            <li> <a ng-href="#">blabla1</a>
            </li>
            <li> <a ng-href="#">blabla2</a>
            </li>
            <li> <a ng-href="#">blabla3</a>
            </li>
        </ul>
    </div>
</li>
<!-- You were missing a closing ul -->
</ul>

你可以在这里查看它在 js fiddle 上的工作

我将以下内容添加到资源中,它对我来说没问题:

http://netdna.bootstrapcdn.com/bootstrap/3.0.3/js/bootstrap.min.js

http://netdna.bootstrapcdn.com/bootstrap/3.0.3/css/bootstrap.min.css

于 2014-01-23T21:02:44.693 回答