Skip to content
Benjamin Albert edited this page Mar 3, 2016 · 3 revisions

OnBeforeMenuOpen

Type: function
Default: null
Since: 2.5
This event is triggered before the Month Picker menu will open and it allows you to prevent the menu from opening. this refers to the associated input field.

Supply a callback function to handle the event as an init option.

$('.selector').MonthPicker({
	OnBeforeMenuOpen: function(event){
		// Make sure the user is aware of the consequences, and prevent opening if they say no.
		if ( !confirm('The field "' + this.id + '" is destructive. Are you sure you want to proceed?') ) {
			event.preventDefault();
		}
	}
});
Get or set the callback function, after init.
//getter
var callback = $('.selector').MonthPicker('option', 'OnBeforeMenuOpen');

//setter
$('.selector').MonthPicker('option', 'OnBeforeMenuOpen', function(){ ... } );

OnAfterMenuOpen

Type: function
Default: null
This event is triggered after the Month Picker menu opens. As of version 2.4 this refers to the associated input field.

Supply a callback function to handle the event as an init option.

$('.selector').MonthPicker({ OnAfterMenuOpen: function(){ ... } });
Get or set the callback function, after init.
//getter
var disabled = $('.selector').MonthPicker('option', 'OnAfterMenuOpen');

//setter
$('.selector').MonthPicker('option', 'OnAfterMenuOpen', function(){ ... } );

OnBeforeMenuClose

Type: function
Default: null
Since: 2.5
This event is triggered before the Month Picker menu will close, and it allows you to prevent the menu from closing. this refers to the associated input field.

Supply a callback function to handle the event as an init option.

$('.selector').MonthPicker({
	OnBeforeMenuClose: function(event){
		// Prevent the menu from closing when clicking on
		// the external button or one of it's child nodes.
		//
		// Note: The first argument of $.contains() must be a DOM element,
		// not a jQuery object or plain JavaScript object.
		if ( $.contains($('#extarnal_button')[0], event.target) ) {
			event.preventDefault();
		}
	}
});
Get or set the callback function, after init.
//getter
var callback = $('.selector').MonthPicker('option', 'OnBeforeMenuClose');

//setter
$('.selector').MonthPicker('option', 'OnBeforeMenuClose', function(){ ... } );

OnAfterMenuClose

Type: function
Default: null
This event is triggered after the Month Picker menu closes. As of version 2.4 this refers to the associated input field.

Supply a callback function to handle the event as an init option.

$('.selector').MonthPicker({ OnAfterMenuClose: function(){ ... } });
Get or set the callback function, after init.
//getter
var disabled = $('.selector').MonthPicker('option', 'OnAfterMenuClose');

//setter
$('.selector').MonthPicker('option', 'OnAfterNextYear', function(){ ... } );

OnAfterSetDisabled

Type: function
Default: null
Since: 2.5
This event is triggered after the Disabled options was changed.

Supply a callback function to handle the event as an init option.

$('.selector').MonthPicker({
	OnAfterSetDisabled: function(isDisabled){
}

});

Get or set the callback function, after init.
//getter
var callback = $('.selector').MonthPicker('option', 'OnAfterSetDisabled');

//setter
$('.selector').MonthPicker('option', 'OnAfterSetDisabled', function(){ ... } );

OnAfterNextYear

Type: function
Default: null
This event is triggered after the Month Picker next year button has been clicked. As of version 2.4 this refers to the associated input field.

Supply a callback function to handle the event as an init option.

$('.selector').MonthPicker({ OnAfterNextYear: function(){ ... } });
Get or set the callback function, after init.
//getter
var disabled = $('.selector').MonthPicker('option', 'OnAfterNextYear');

//setter
$('.selector').MonthPicker('option', 'OnAfterNextYear', function(){ ... } );

OnAfterNextYears

Type: function
Default: null
This event is triggered after the Month Picker next 5 years button has been clicked. As of version 2.4 this refers to the associated input field.

Supply a callback function to handle the event as an init option.

$('.selector').MonthPicker({ OnAfterNextYears: function(){ ... } });
Get or set the callback function, after init.
//getter
var disabled = $('.selector').MonthPicker('option', 'OnAfterNextYears');

//setter
$('.selector').MonthPicker('option', 'OnAfterNextYears', function(){ ... } );

OnAfterPreviousYear

Type: function
Default: null
This event is triggered after the Month Picker previous year button has been clicked. As of version 2.4 this refers to the associated input field.

Supply a callback function to handle the event as an init option.

$('.selector').MonthPicker({ OnAfterPreviousYear: function(){ ... } });
Get or set the callback function, after init.
//getter
var disabled = $('.selector').MonthPicker('option', 'OnAfterPreviousYear');

//setter
$('.selector').MonthPicker('option', 'OnAfterPreviousYear', function(){ ... } );

OnAfterPreviousYears

Type: function
Default: null
This event is triggered after the Month Picker previous 5 years button has been clicked. As of version 2.4 this refers to the associated input field.

Supply a callback function to handle the event as an init option.

$('.selector').MonthPicker({ OnAfterPreviousYears: function(){ ... } });
Get or set the callback function, after init.
//getter
var disabled = $('.selector').MonthPicker('option', 'OnAfterPreviousYears');

//setter
$('.selector').MonthPicker('option', 'OnAfterPreviousYears', function(){ ... } );

OnAfterChooseMonth

Type: function
Default: null
This event is triggered after the Month Picker month button has been clicked. As of version 2.4 this refers to the associated input field.

Supply a callback function to handle the event as an init option.

$('.selector').MonthPicker({ OnAfterChooseMonth: function( selectedDate ){ ... } });
Get or set the callback function, after init.
//getter
var disabled = $('.selector').MonthPicker('option', 'OnAfterChooseMonth');

//setter
$('.selector').MonthPicker('option', 'OnAfterChooseMonth', function(){ ... } );

OnAfterChooseMonths

Type: function
Default: null
This event is triggered after the Month Picker choose months button has been clicked. As of version 2.4 this refers to the associated input field.

Supply a callback function to handle the event as an init option.

$('.selector').MonthPicker({ OnAfterChooseMonths: function(){ ... } });
Get or set the callback function, after init.
//getter
var disabled = $('.selector').MonthPicker('option', 'OnAfterChooseMonths');

//setter
$('.selector').MonthPicker('option', 'OnAfterChooseMonths', function(){ ... } );

OnAfterChooseYear

Type: function
Default: null
This event is triggered after the Month Picker choose year button has been clicked. As of version 2.4 this refers to the associated input field.

Supply a callback function to handle the event as an init option.

$('.selector').MonthPicker({ OnAfterChooseYear: function(){ ... } });
Get or set the callback function, after init.
//getter
var disabled = $('.selector').MonthPicker('option', 'OnAfterChooseYear');

//setter
$('.selector').MonthPicker('option', 'OnAfterChooseYear', function(){ ... } );

OnAfterChooseYears

Type: function
Default: null
This event is triggered after the Month Picker choose years button has been clicked. As of version 2.4 this refers to the associated input field.

Supply a callback function to handle the event as an init option.

$('.selector').MonthPicker({ OnAfterChooseYears: function(){ ... } });
Get or set the callback function, after init.
<pre>

//getter var disabled = $('.selector').MonthPicker('option', 'OnAfterChooseYears');

//setter $('.selector').MonthPicker('option', 'OnAfterChooseYears', function(){ ... } );