Opened 13 years ago

Closed 10 years ago

Last modified 10 years ago

#5574 closed feature (wontfix)

Extend DatePicker with a NotifyUpdate event.

Reported by: Reinout Owned by:
Priority: major Milestone:
Component: ui.datepicker Version: 1.8
Keywords: event notifyupdate update Cc:
Blocked by: Blocking:

Description

After updating the date in the input text field, the DatePicker gets updated automatically, re-rendering the date control. When using the DatePicker control as a DateTimePicker (i.e. extending it with a time section underneath the date section), an event notifying this update to inheriting controls would make life a lot easier : it will be possible to re-render the time controls as well.

e.g. ...

_updateDatepicker: function(inst) { ...

this._notifyUpdate(inst);

},

/* Notify update of datepicker. */ _notifyUpdate: function(inst) {

var onNotifyUpdate = this._get(inst, 'onNotifyUpdate'); if (onNotifyUpdate)

onNotifyUpdate.apply();

},

...

This could then be used in the add-on as follows : ...

var tp = new Timepicker();

...

onNotifyUpdate: function (inst) {

tp.addTimePicker();

if ($.isFunction(oonNotifyUpdate?)) o.onNotifyUpdate(inst);

}

...

Attachments (1)

jquery.ui.datepicker.js (88.2 KB) - added by Reinout 13 years ago.
Update DatePicker js

Download all attachments as: .zip

Change History (4)

Changed 13 years ago by Reinout

Attachment: jquery.ui.datepicker.js added

Update DatePicker js

comment:1 Changed 12 years ago by filipiz

I have a similar issue and similar implementation. Would be very usefull this event.

comment:2 Changed 10 years ago by Scott González

Resolution: wontfix
Status: newclosed

Datepicker already calls three different methods when this happens: _setDateFromField(), _updateAlternate(), and _updateDatepicker(). Just pick the most appropriate one and proxy it.

comment:3 Changed 10 years ago by Scott González

Milestone: TBD

Milestone TBD deleted

Note: See TracTickets for help on using tickets.