jqwidgets-framework
Version:
jQWidgets is an advanced Angular, Vue, Blazor, React, Web Components, jquery, ASP .NET MVC, Custom Elements and HTML5 UI framework.
86 lines (80 loc) • 4.51 kB
HTML
<html lang="en">
<head>
<meta name="keywords" content="jQuery DropDownList, List, ListBox, Popup List, jqxDropDownList, jqxListBox, List Widget, ListBox Widget, DropDownList Widget" />
<meta name="description" content="The jqxListBox can be populated with data from an existing select element making it easier to upgrade your pages using jqxListBox."/>
<title id='Description'>The jqxListBox can be populated with data from an existing select element making it easier to upgrade your pages using jqxListBox.</title>
<link rel="stylesheet" href="../../../jqwidgets/styles/jqx.base.css" type="text/css" />
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<meta name="viewport" content="width=device-width, initial-scale=1 maximum-scale=1 minimum-scale=1" />
<script type="text/javascript" src="../../../scripts/jquery-1.12.4.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>
</head>
<body>
<div id='content'>
<script type="text/javascript">
$(document).ready(function () {
var updating = false;
// Create a jqxListBox
$("#jqxListBox").jqxListBox({ width: 200, height: 250});
// Load the data from the Select html element.
$("#jqxListBox").jqxListBox('loadFromSelect', 'select');
$("#jqxListBox").on('select', function (event) {
if (event.args && !updating) {
var args = event.args;
// select the item in the 'select' tag.
var index = args.item.index;
$("#select").val(args.item.value);
}
});
$("#select").on('change', function (event) {
updating = true;
var index = $("#select")[0].selectedIndex;
$("#jqxListBox").jqxListBox('selectIndex', index);
$("#jqxListBox").jqxListBox('ensureVisible', index);
updating = false;
});
});
</script>
<div style='float: left; width: 500px;' id='jqxWidget'>
<div style='float: left;' id='jqxListBox'></div>
<div style='float: left;' id='Select'>
<select style='height: 250px; width: 200px; margin-left: 30px;' size='2' id='select'>
<option>Affogato</option>
<option>Americano</option>
<option>Bicerin</option>
<option>Breve</option>
<option>Café Bombón</option>
<option>Caffé Corretto</option>
<option>Café Crema</option>
<option>Caffé Latte</option>
<option>Caffé macchiato</option>
<option>Café mélange</option>
<option>Coffee milk</option>
<option>Cafe mocha</option>
<option>Cappuccino</option>
<option>Carajillo</option>
<option>Cuban espresso</option>
<option>Espresso</option>
<option selected="true">The Flat White</option>
<option>Frappuccino</option>
<option>Galao</option>
<option>Greek frappé coffee</option>
<option>Iced Coffee</option>
<option>Indian filter coffee</option>
<option>Instant coffee</option>
<option>Irish coffee</option>
<option>Liqueur coffee</option>
</select>
</div>
</div>
</div>
<div style="position: absolute; bottom: 5px; right: 5px;">
<a href="https://www.jqwidgets.com/" alt="https://www.jqwidgets.com/"><img alt="https://www.jqwidgets.com/" title="https://www.jqwidgets.com/" src="https://www.jqwidgets.com/wp-content/design/i/logo-jqwidgets.png"/></a>
</div>
</body>
</html>