Search code examples
jqueryuser-interfaceselectable

How to enable dblclick event on elements which was binded with JQuery UI Selectable plugin?


In my case,I have an UL with JQuery UI Selectable plugin applied,but at the same time ,I want the item witch was binded with selectable plugin was doing something when I double click this item.But it seems that the JQuery UI Selectable plugin had block the dblclick event. So,how can I make it work?

E.g:

<script>
    $(function() {
        $( "#selectable" ).selectable();

                $( "#selectable" ).dblclick(function(){
                    // do something here
                })
    });
    </script>

<ul id="selectable">
    <li class="ui-widget-content">Item 1</li>
    <li class="ui-widget-content">Item 2</li>
    <li class="ui-widget-content">Item 3</li>
    <li class="ui-widget-content">Item 4</li>
    <li class="ui-widget-content">Item 5</li>
    <li class="ui-widget-content">Item 6</li>
    <li class="ui-widget-content">Item 7</li>
</ul>

Thank you very much!!


Solution

  • In jQuery you can link events, like this:

    $( "#selectable" ).selectable().dblclick();
    

    Bit I'm not sure this will work, because both events are click events.