#4921 closed bug (notabug)
datepicker can't be clone propertily
Reported by: | pokerwen | Owned by: | |
---|---|---|---|
Priority: | critical | Milestone: | |
Component: | ui.datepicker | Version: | 1.7.2 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
i have a input linked to datepicker in my demo. i can't clone the datepicker after i do some steps like below: 1.focus on the last cell in the first row, so that call out the datepicker; 2.click "add Row"; 3.new row is added; 3.focus on the last cell in the last row. the datepicker dose not work.
but if i omit the step 1,the demo is ok.. please kindly help.
Attachments (1)
Change History (7)
Changed 13 years ago by
Attachment: | datepicker test.rar added |
---|
comment:2 Changed 13 years ago by
I finally worked it out.. i flow steps shown below: 1.clone the element which need to show DatePicker 2.the "hasDatepicker" class should be remove after being clone 3.call $(object).datepicker();
comment:4 Changed 11 years ago by
Please reopen this ticket.
The way the datepicker is implemented doesnt allow it to be cloned. There are numerous of clumsy workarounds on the internet like this one:
http://stackoverflow.com/questions/2358905/cloning-datepicker-objects-jquery
Most of them have side effects and are ugly.
So i still consider this a bug: I think the datepicker should be implemented in such a way it can be cloned without a problem.
If thats difficult because we cant do without that unique id-attribute, then we should add a datepicker("reinit") function. (datepicker("refresh") doenst seem to deal with this)
comment:5 Changed 11 years ago by
See #3803. We don't support this for any widget, and likely won't.
please call me when i dosn't describe the problem clearily