From 8d7cebd67e7fbca21ff17ec10a435538db103e0a Mon Sep 17 00:00:00 2001 From: calimero Date: Fri, 29 Jul 2011 13:15:08 -0400 Subject: [PATCH] add onUpdate event with callback function --- js/ui.multiselect.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/js/ui.multiselect.js b/js/ui.multiselect.js index 1234fa7..b4d69a1 100755 --- a/js/ui.multiselect.js +++ b/js/ui.multiselect.js @@ -36,6 +36,7 @@ $.widget("ui.multiselect", { show: 'slideDown', hide: 'slideUp', dividerLocation: 0.6, + onUpdate: null, // Define a callback function when a update nodeComparator: function(node1,node2) { var text1 = node1.text(), text2 = node2.text(); @@ -158,6 +159,10 @@ $.widget("ui.multiselect", { }, _updateCount: function() { this.selectedContainer.find('span.count').text(this.count+" "+$.ui.multiselect.locale.itemsCount); + // callback after node insertion + if ('function' == typeof this.options.onUpdate) { + this.options.onUpdate(); + } }, _getOptionNode: function(option) { option = $(option);