Function Repeat Test
My function to test how it repeats
HTML
<link rel="stylesheet" href="http://jqwidgets.com/public/jqwidgets/styles/jqx.base.css">
<link rel="stylesheet" href="http://jqwidgets.com/public/jqwidgets/styles/jqx.energyblue.css">
<script src="http://jqwidgets.com/public/jqwidgets/jqx-all.js"></script>
<div id="modalNewDash">
<div class="modalHeader">New</div>
<div class="modalContent">#1
<div id="combo1"></div>#2
<div id="combo2"></div>#3
<div id="combo3"></div>
<input type="button" value="Close" id="btnNewDashCancel" />
</div>
</div>
<input type="button" value="Open" id='jqxButton' />
JavaScript
var createModals = (function () {
function _checkForValues(i) {
return function () {
alert("check combo " + i);
};
};
function _createElements() {
$('#modalNewDash').jqxWindow({
height: 300,
width: 300,
showCloseButton: false,
autoOpen: false,
draggable: false,
resizable: false,
isModal: true,
modalOpacity: 0.6,
showAnimationDuration: 600
});
var source = [
"Affogato",
"Americano",
"Bicerin",
"Breve",
"Café Bombón",
"Café au lait",
"Caffé Corretto",
"Café Crema",
"Caffé Latte"];
var allData = new $.jqx.dataAdapter(source, {
loadComplete: function (records) {
var srcRecords = allData.records;
$("#combo1").jqxComboBox({
source: srcRecords,
width: '240'
});
$("#combo2").jqxComboBox({
source: srcRecords,
width: '240'
});
$("#combo3").jqxComboBox({
source: srcRecords,
width: '240'
});
}
});
allData.dataBind();
}; // CLOSING createElements FUNCTION
function _addEventListeners() {
$("#jqxButton").click(function () {
$("#combo1").jqxComboBox({
selectedIndex: 0
});
$("#combo2").jqxComboBox({
selectedIndex: 0
});
$("#combo3").jqxComboBox({
selectedIndex: 0
});
$('#modalNewDash').jqxWindow('open');
$("#combo1").jqxComboBox("selectItem", "Breve");
$("#combo2").jqxComboBox("selectItem", "Café Bombón");
...