Bug Tracker

Modify

Ticket #2672 (closed bug: fixed)

Opened 5 years ago

Last modified 5 years ago

new datepicker timing issue

Reported by: balliano Owned by: iMarc
Priority: major Milestone: 1.2.4
Component: ui Version: 1.2.3
Keywords: datepicker Cc:
Blocking: Blocked by:

Description

hi, i'm running the datepicker in a full ajax context, also datepicker js/css are not in the document's head but loaded when needed (when the ajax call returns a datepicker widget)

problem comes in js line 1433


/* Initialise the date picker. */ $(document).ready(function() {

$(document.body).append($.datepicker._datepickerDiv)

.mousedown($.datepicker._checkExternalClick);

});

$.datepicker = new Datepicker(); singleton instance


it happens that $(document).ready is executed BEFORE the "new datepicker" is called, thus I get an error. to solve the problem just move the "new datepicker" inside the $(document).ready:


/* Initialise the date picker. */ $(document).ready(function() {

$.datepicker = new Datepicker(); singleton instance $(document.body).append($.datepicker._datepickerDiv)

.mousedown($.datepicker._checkExternalClick);

});


Attachments

new code chunk.txt Download (227 bytes) - added by balliano 5 years ago.
changed a bit after more tests

Change History

Changed 5 years ago by balliano

changed a bit after more tests

comment:1 Changed 5 years ago by balliano

the right patch is the one in the attached file :-)

comment:2 Changed 5 years ago by paul

  • Owner changed from paul to iMarc

comment:3 Changed 5 years ago by paul

  • Status changed from new to closed
  • Resolution set to fixed

Fixed in r5407, thanks!

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.