Commit 48365e43 authored by Peter Beno's avatar Peter Beno

Added elemental implementation of onchange event

parent aca02c24
...@@ -16,7 +16,9 @@ ...@@ -16,7 +16,9 @@
<body> <body>
<script type="text/javascript"> <script type="text/javascript">
$(document).ready(function() { $(document).ready(function() {
$('#example1').multiselect(); $('#example1').multiselect({
onchange:function(){alert('change event invoked!');}
});
$('#example2').multiselect(); $('#example2').multiselect();
$('#example3').multiselect({ $('#example3').multiselect({
button: 'btn btn-link' button: 'btn btn-link'
......
...@@ -68,6 +68,7 @@ ...@@ -68,6 +68,7 @@
$('option[value="' + $(event.target).val() + '"]', this.select).attr('selected', checked); $('option[value="' + $(event.target).val() + '"]', this.select).attr('selected', checked);
$('button', this.container).html(this.options.text($('option:selected', this.select)) + ' <b class="caret"></b>'); $('button', this.container).html(this.options.text($('option:selected', this.select)) + ' <b class="caret"></b>');
this.options.onchange();
}, this)); }, this));
$('ul li a', this.container).on('click', function(event) { $('ul li a', this.container).on('click', function(event) {
...@@ -99,6 +100,7 @@ ...@@ -99,6 +100,7 @@
} }
}, },
container: '<div class="btn-group" />', container: '<div class="btn-group" />',
onchange:function(){}
}, },
constructor: Multiselect, constructor: Multiselect,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment