jQuery UI Widgets Forums Lists ListBox double or right click event

This topic contains 4 replies, has 2 voices, and was last updated by  Dimitar 10 years, 11 months ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
  • double or right click event #30119

    jon74
    Participant

    Hi all,
    is there a way to bind double click event on a listbox item? or also other list widget?
    I’ve seen that there’s no event other than common “select”, or “change” and so on…
    I tried with jQuery binding but it attaches it to the widget DIV element, and not to the single item.

    Thanks
    Jon

    double or right click event #30120

    Dimitar
    Participant

    Hello Jon,

    Here is how to bind to the jQuery dblclick event on a listbox item:

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <link rel="stylesheet" href="../../jqwidgets/styles/jqx.base.css" type="text/css" />
    <script type="text/javascript" src="../../scripts/gettheme.js"></script>
    <script type="text/javascript" src="../../scripts/jquery-1.10.2.min.js"></script>
    <script type="text/javascript" src="../../jqwidgets/jqxcore.js"></script>
    <script type="text/javascript" src="../../jqwidgets/jqxbuttons.js"></script>
    <script type="text/javascript" src="../../jqwidgets/jqxscrollbar.js"></script>
    <script type="text/javascript" src="../../jqwidgets/jqxlistbox.js"></script>
    </head>
    <body>
    <div id='content'>
    <script type="text/javascript">
    $(document).ready(function () {
    var theme = "";
    var source = [
    "Affogato",
    "Americano",
    "Bicerin",
    "Breve",
    "Café Bombón",
    "Café au lait",
    "Caffé Corretto",
    "Café Crema",
    "Caffé Latte",
    "Caffé macchiato",
    "Café mélange",
    "Coffee milk",
    "Cafe mocha",
    "Cappuccino",
    "Carajillo",
    "Cortado",
    "Cuban espresso",
    "Espresso",
    "Eiskaffee",
    "The Flat White",
    "Frappuccino",
    "Galao",
    "Greek frappé coffee",
    "Iced Coffee",
    "Indian filter coffee",
    "Instant coffee",
    "Irish coffee",
    "Liqueur coffee"
    ];
    // Create a jqxListBox
    $("#jqxWidget").jqxListBox({ selectedIndex: 3, source: source, width: 200, height: 250, theme: theme });
    $("#jqxWidget .jqx-listitem-element").dblclick(function () {
    alert("Double click");
    });
    });
    </script>
    <div id='jqxWidget'>
    </div>
    </div>
    </body>
    </html>

    Best Regards,
    Dimitar

    jQWidgets team
    http://www.jqwidgets.com/

    double or right click event #30129

    jon74
    Participant

    thanks a lot Dimitar!

    double or right click event #30168

    jon74
    Participant

    hmmm it does not work to me 🙁

    double or right click event #30205

    Dimitar
    Participant

    Hi Jon,

    Does the example not work for you? Have you updated to jQWidgets version 3.0.3?

    Best Regards,
    Dimitar

    jQWidgets team
    http://www.jqwidgets.com/

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.