Opened 12 years ago
Last modified 9 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 12 years ago by
comment:2 Changed 11 years ago by
I also need this event to apply advanced formatting. It can be added to the end of the _updateDatepicker function.
comment:3 Changed 11 years ago by
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 11 years ago by
Type: | enhancement → feature |
---|
comment:5 Changed 10 years ago by
Milestone: | 1.9.0 → 1.11.0 |
---|
comment:6 Changed 10 years ago by
Status: | new → open |
---|
comment:7 Changed 9 years ago by
Milestone: | 1.11.0 → none |
---|
comment:8 Changed 9 years ago by
This should just be implemented as an open
event to match other widgets. The beforeShow
callback will be removed.
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.