jQWidgets Forums
jQuery UI Widgets › Forums › Lists › DropDownList › Stop open by right click
Tagged: DropDownList, jqxDropDownList, open, right click
This topic contains 4 replies, has 2 voices, and was last updated by Nadezhda 10 years, 3 months ago.
-
AuthorStop open by right click Posts
-
Hi,
how to set the property of jqxDropDownList to not open on right click. While by default on right click it get opened.thanks
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,
NadezhdajQWidgets team
http://www.jqwidgets.com/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 NazirHi Tahir Nazir,
Unfortunately, it is not possible to select item only with left or right button click.
Best Regards,
NadezhdajQWidgets team
http://www.jqwidgets.com/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,
NadezhdajQWidgets team
http://www.jqwidgets.com/ -
AuthorPosts
You must be logged in to reply to this topic.