EasyUI Forum
May 01, 2024, 02:26:29 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: spinning the spinner  (Read 4075 times)
korenanzo
Guest
« on: October 24, 2016, 12:10:08 AM »

Hi,

I need to do some things  when the user clicks the arrows of a nummberspinner, before incrementing/decrementing the spin.

I can set the spin() function, but into it I should call the actual function that do the increase of the spinner. How can I do it?

Thanks,
RIc
Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #1 on: October 24, 2016, 01:25:29 AM »

Please try this code to add the 'onBeforeSpin' event to the numberspinner plugin.

Code:
<script type="text/javascript">
(function($){
var spin = $.fn.numberspinner.defaults.spin;
$.extend($.fn.numberspinner.defaults, {
spin: function(down){
var opts = $(this).numberspinner('options');
if (opts.onBeforeSpin){
opts.onBeforeSpin.call(this, down);
}
spin.call(this, down);
}
});
})(jQuery);
</script>
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!