engineer9090909090909090 / jquery-datepicker

Automatically exported from code.google.com/p/jquery-datepicker
0 stars 0 forks source link

Datepicker not created for new fields dynamically added with ajax. #188

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
A form has one datepicker when it is loaded. Ajax is used to create 
multiple datepickers thereafter. These subsequently created ones do not 
work. Only the first one works.

What is the expected output? What do you see instead?
I understand the "problem" is due to the fact that any new elements will 
not be associated with the existing funtion. It probably would involve the 
use of .live().

Please provide a URL to a page displaying the problem.

http://ext.gcitexas.com/client/problem.htm
What version of the datepicker are you using? On what operating system? 
And Which Browser?

Please provide any additional information below.

Original issue reported on code.google.com by kamils...@gmail.com on 29 Mar 2010 at 4:37

GoogleCodeExporter commented 8 years ago
Same problem here, if someone could provide the init code with the jQuery live
method, that would be all fixed.

Original comment by fmalina on 30 Apr 2010 at 10:44

GoogleCodeExporter commented 8 years ago
All you need to do is initialise your date pickers in the load callback for the 
ajax
request.

So something like:

$('#your-element-id').load('your-ajax-url', function()
{
// reinitialise your date pickers inside the loaded content:
$('#your-element-id .date-picker').datePicker();
});

Original comment by kelvin.l...@gmail.com on 1 May 2010 at 12:29