Ticket #6804 (closed feature: fixed)
Added 'changeData' event that fires after data updated via fn.data()
| Reported by: | dareed | Owned by: | |
|---|---|---|---|
| Priority: | Milestone: | 1.4.3 | |
| Component: | data | Version: | 1.4.2 |
| Keywords: | data setData | Cc: | |
| Blocking: | Blocked by: |
Description
The data linking plugin uses the fact that you can set data on plain objects with the $.fn.data API, and uses the 'setData' event to be notified of changes, so they can be pushed back to the link's source input.
However, the setData event fires before the data has changed, as it seems to be more meant to be an event meant to allow subscribers to customize how the data is stored. This is not ideal semantics for the linking scenario, and there's no elegant workaround. A changeData event would be meant for notification of changes and will help enable general mutation notifications.
Change History
Please follow the bug reporting guidlines and use jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

branch w/ fix: http://github.com/nje/jquery/tree/ChangeData