jQWidgets Forums

jQuery UI Widgets Forums Lists DropDownList Stop open by right click

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

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
  • Stop open by right click #64844

    Tahir Nazir
    Participant

    Hi,
    how to set the property of jqxDropDownList to not open on right click. While by default on right click it get opened.

    thanks

    Stop open by right click #64942

    Nadezhda
    Participant

    Hello Tahir Nazir,

    Here is an example which shows how to not open the jqxDropDownList on right click. I hope it would be helpful.

    <!DOCTYPE html>
    <html lang="en">
    <head>    
        <title></title>
        <link rel="stylesheet" href="../../jqwidgets/styles/jqx.base.css" type="text/css" />
        <script type="text/javascript" src="../../scripts/jquery-1.11.1.min.js"></script>
        <script type="text/javascript" src="../../scripts/demos.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>
        <script type="text/javascript" src="../../jqwidgets/jqxdropdownlist.js"></script>
    </head>
    <body>
        <div id='content'>
            <script type="text/javascript">
                $(document).ready(function () {                
                    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 jqxDropDownList
                    $("#jqxWidget").jqxDropDownList({ source: source, selectedIndex: 1, width: '200', height: '25' });
                    $(document).mousedown(function (e) {
                        if (e.button == 2) {
                            $('#jqxWidget').jqxDropDownList({ closeDelay: 0 });
                            $("#jqxWidget").jqxDropDownList("close");
                            return false;
                        }
                        return true;
                    });
                });
            </script>
            <div id='jqxWidget'>
            </div>
        </div>
    </body>
    </html>

    Best Regards,
    Nadezhda

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

    Stop open by right click #65416

    Tahir Nazir
    Participant

    Hello Nadezhda,
    thanks a lot for your reply. Can you please let me know that how to enalbe the checkbox check only with right click. Same I would like to know that how can I make it for normal dropdown (without checkbox) too, so that it will get selected only upon left click.

    Kind Regards,
    Tahir Nazir

    Stop open by right click #65427

    Nadezhda
    Participant

    Hi Tahir Nazir,

    Unfortunately, it is not possible to select item only with left or right button click.

    Best Regards,
    Nadezhda

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

    Stop open by right click #65437

    Nadezhda
    Participant

    Hi Tahir Nazir,

    I would like to give you more information about the above post. It is not possible to check checkboxes with only right button click.
    By default you can select item with left button click,but you can not select items with only left button click.

    Best Regards,
    Nadezhda

    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.