Opened 8 years ago

Last modified 5 years ago

#6885 open feature

Add "afterShow" event to datepicker core

Reported by: bkellgren Owned by:
Priority: minor Milestone: none
Component: ui.datepicker Version: 1.8.8
Keywords: Cc:
Blocked by: Blocking:

Description

In my current group we are finding the need to extend date picker with an afterShow event. This is the second time I have had to do this for an implementation. Just thought I would suggest this as an enhancement or at least inquire why the decision was made to not include it previously. Thanks in advance, I hope this is the right forum for this request as it is my first.

Change History (8)

comment:1 Changed 8 years ago by Evil Raat

I would also like to see this event added to the datepicker. I have been trying to implement a more advanced view of the datepicker for displaying custom content within the date fields.

Adding this event would allow much greater customisation of the rendered datepicker.

comment:2 Changed 7 years ago by ruslan

I also need this event to apply advanced formatting. It can be added to the end of the _updateDatepicker function.

comment:3 Changed 7 years ago by Pony

Hi,

if you need a "afterShow"-event befor version 1.9 you can overwrite the datepicker._updateDatepicker fuction.

for example:

$(function() {
	$.datepicker._updateDatepicker_original = $.datepicker._updateDatepicker;
	$.datepicker._updateDatepicker = function(inst) {
		$.datepicker._updateDatepicker_original(inst);
		var afterShow = this._get(inst, 'afterShow');
		if (afterShow)
			afterShow.apply((inst.input ? inst.input[0] : null));  // trigger custom callback
	}
});

I know it isn't the best way to slove this problem, but it's better than change the original jquery-ui code.

comment:4 Changed 7 years ago by Scott González

Type: enhancementfeature

comment:5 Changed 6 years ago by Scott González

Milestone: 1.9.01.11.0

comment:6 Changed 6 years ago by mikesherov

Status: newopen

comment:7 Changed 5 years ago by Scott González

Milestone: 1.11.0none

comment:8 Changed 5 years ago by Scott González

This should just be implemented as an open event to match other widgets. The beforeShow callback will be removed.

Note: See TracTickets for help on using tickets.