Bug init SwitchButton on FALSE

by mogador

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>
<p>
Change Switch button.<br />
</p>
<div id="jqxSwitchButton"></div>
<br />

JavaScript

function JQXSwitchButton(sIDSwitchButton)
{
    // ID du Champ
    this.sIDChamp = sIDSwitchButton;

    // Initialisation
    $("#" + this.sIDChamp).jqxSwitchButton({ theme: 'darkblue', checked: true});
}

JQXSwitchButton.prototype.check = function(bCheck)
{
    if(bCheck == true)
        $("#" + this.sIDChamp).jqxSwitchButton('check');
    else
        $("#" + this.sIDChamp).jqxSwitchButton('uncheck');
};



$('#jqxSwitchButton').jqxSwitchButton({
    height: 35,
    width: 80,
    theme: 'energyblue'
});


$('#jqxSwitchButton').on('change', function (event) {
	var checked = $('#jqxSwitchButton').jqxSwitchButton('checked');

    alert("onChange : the value of the button is " + checked);
});


// radio
 $("#jqxRadioButton").jqxRadioButton({
     width: 120,
     height: 25,
     theme: 'energyblue'
 });
 $("#jqxRadioButton2").jqxRadioButton({
     width: 120,
     height: 25,
     theme: 'energyblue'
 });
 $('#jqxRadioButton').on('change', function (event) {
 	var value = $("#jqxRadioButton").val();
 
     alert("onChange : the state of jqxRadioButton is " + value);
 });
 
  $('#jqxRadioButton2').on('change', function (event) {
 	var value = $("#jqxRadioButton2").val();
 
     alert("onChange : the state of jqxRadioButton2 is " + value);
 });
 
 // dropdown
  var source = [
       "Affogato",
       "Americano",
       "Bicerin",
       "Breve",
       "Café Bombón",
       "Café au lait",
       "Caffé Corretto",
       "Café Crema",
       "Caffé Latte"];
   // Create a jqxDropDownList
   $("#jqxDropDownList").jqxDropDownList({
       source: source,
       theme: 'energyblue',
       width: '200px',
       height: '25px',
       selectedIndex: 3
   });
   $('#jqxDropDownList').on('change', function (event) {
   var selectedIndex = $('#jqxDropDownList').jqxDropDownList('selectedIndex'); 
   alert(" index selected is " + selectedIndex);
   });