Wijmo 5 - InputNumber
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>InputNumber</h1>
</p> 1: click to input control </p>
</p> 2: click to submit button to fire onLostFocus event</p>
</p> 3: Popup Correct or Incorrect will be shown</p>
<div id="theInteger"></div>
</br>
<button type="button" id="submitBtn">
submit
</button>
</div>
CSS
.wj-control {
margin-bottom: 24px;
}
JavaScript
onload = function () {
// create all the InputNumber controls
var niInteger = new wijmo.input.InputNumber('#theInteger', {
min: 0,
max: 10,
format: 'n0',
placeholder: 'integer between zero and ten'
});
niInteger.lostFocus.addHandler(function(s, e) {
//alert("lostfocus");
});
document.getElementById('submitBtn').addEventListener('click', function(e) {
alert("click")
})
document.addEventListener('touchstart', function(e) {
if (e.target.tagName == 'BUTTON') {
//e.target.focus();
}
}, true)
}