Demo - Wijmo Events

HTML

<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css">
<link rel="stylesheet" href="https://cdn.grapecity.com/wijmo/5.latest/styles/wijmo.min.css">
<script src="https://cdn.grapecity.com/wijmo/5.latest/controls/wijmo.min.js"></script>
<script src="https://cdn.grapecity.com/wijmo/5.latest/controls/wijmo.input.min.js"></script>
<div class="container">

  <h1>
    Wijmo Events</h1>
  <p>
    HTML5 has an eventing mechanism that works for HTML elements.
    But it cannot be used to add events to arbitrary objects, 
    such as controls and collections.</p>
  <p>
    Because of this, Wijmo defines an <b>Event</b> class. Any class 
    may define events by declaring them as fields, and any class may
    add or remove event handlers using the event's <b>addHandler</b>
    and <b>removeHandler</b> methods.</p>
  <p>
    You may also declare event handlers as <b>options</b> in any
    Wijmo control's constructor.</p>
  <p>
    All Wijmo event handlers take two parameters: <b>sender</b> 
    and <b>args</b>.
    The first is the object that raised the event, and the second 
    is an object that contains the event parameters.</p>  
  <p>
    Here are some input controls with Wijmo event handlers attached:</p>
  <p>
    <span id="theCombo"></span>
    <span id="theDate"></span>
  </p>
  
  <div class="panel panel-warning">
    <div class="panel-heading">
      For more details on Wijmo and HTML events, please refer to 
      our blog on 
      <a href="https://wijmo.com/blog/html-and-wijmo-events/">HTML and Wijmo Events</a>.
    </div>
  </div>

</div>

JavaScript

onload = function() {

	// create some input controls
  var theCombo = new wijmo.input.ComboBox('#theCombo', {
    itemsSource: 'US,Germany,UK,Japan,Italy,Greece'.split(','),
    selectedIndexChanged: function(s, e) {
    	alert('You selected a new item: ' + s.selectedValue);
    }
  });
  var theDate = new wijmo.input.InputDate('#theDate', {
    valueChanged: function(s, e) {
    	alert('You selected a new date: ' + s.value)
    }
  });
}