Opened 20 months ago
Last modified 13 months ago
#3850 new Enhancement
elgg.ui.initDatePicker not initializing on ajax calls
| Reported by: | ismayil.khayredinov | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | Near Term Future Release |
| Component: | JavaScript | Version: | 1.8 |
| Severity: | minor | Keywords: | |
| Cc: | brett@… | Difficulty: |
Description
All methods in ui.js are live, aside from initDatePicker. If elgg.ui.init is called on ajax success, there are multiple problems with propagation. Perhaps it would be a good idea to separate live and bind methods, and ideally create a separate ui.init function for ajax calls.
Change History (5)
comment:1 Changed 20 months ago by ismayil.khayredinov
- Component changed from Core to UI/UX
- Type changed from Defect to Enhancement
- Version changed from 1.7 to 1.8
comment:2 Changed 20 months ago by ewinslow
comment:3 Changed 17 months ago by ismayil.khayredinov
Any further thoughts on this?
comment:4 Changed 17 months ago by cash
- Component changed from UI/UX to JavaScript
We need to come up with a solution that is general - like Evan described. That would be for Elgg 1.9.
For Elgg 1.8, we could come up with a special solution for this.
comment:5 Changed 13 months ago by ewinslow
- Milestone changed from Needs Review to Near Term Future Release
This is probably not going to happen for 1.9, but should happen soon.
Note: See
TracTickets for help on using
tickets.

The JS Framework is clearly still in its infancy. Handling ajax requests is still not really supported.
We need a standard way to provide initialization code that doesn't require the users to think about ajax or delegation or liveness or any of that. E.g...
elgg.ui.Datepicker.init = function(context) { // Only initialize *new* content (i.e. stuff in "context") $('.elgg-input-date', context).elggDatepicker(); }; // Run this callback on DOM ready and whenever new HTML is inserted into the page elgg.fancyCallbackRegistrationThingy(elgg.ui.Datepicker.init);