#3945 closed bug (fixed)
DatePicker does not respond to any click events in AIR, Google Sites, Windows Metro
Reported by: | canthonyza | Owned by: | |
---|---|---|---|
Priority: | major | Milestone: | 1.8.22 |
Component: | ui.datepicker | Version: | 1.6rc5 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
The DatePicker renders perfectly with Themeroller also disappears when out of focus, but seems like none of the click events are being fired. Can't move to next or previous month/year.
Please let me know if there is any other info I can give you.
Attachments (1)
Change History (24)
comment:1 Changed 15 years ago by
Milestone: | TBD → 1.next |
---|---|
Priority: | minor → blocker |
Changed 15 years ago by
Attachment: | index.html added |
---|
comment:2 Changed 15 years ago by
i got the exactly same problem. I attached my stripped 'index.html' of my AIR app.
comment:4 Changed 15 years ago by
Same here... doesn't work in AIR yet. (Not as of 1.7) Will this be working in 1.7.1?
comment:5 Changed 14 years ago by
Most likeley related to this security restriction of the AIR sandbox:
Supports dynamically loading strings as code after the load event: eval() function, setTimeout('string', milis), javascript: URLs, attribute handlers on elements such as onclick='myClick()') that are inserted via innnerHTML, and so on.
comment:6 Changed 14 years ago by
I thought 1.7 suppose to have full Air support? Still not working in 1.7.1.
comment:7 Changed 14 years ago by
Hi
For some strange reason Adobe AIR refuses to accept dynamically created onclick="" attributes. For example div.innerHTML='<a onclick="[javascript code]"> ' would not work.
You have to dynamically add the click's back in. You have two options.
Option 1: You can change the ui.datepicker.js file by putting:
AFTER THIS CODE (around line 620):
if (inst.input && inst.input[0].type != 'hidden' && inst == $.datepicker._curInst) $(inst.input[0]).focus();
PUT THIS CODE
id = "#"+$(inst).attr("id"); $(".ui-datepicker-next").click(function() { DP_jQuery.datepicker._adjustDate(id, +1, 'M'); }); $(".ui-datepicker-prev").click(function() { DP_jQuery.datepicker._adjustDate(id, -1, 'M'); }); drawMonth = inst.drawMonth; drawYear = inst.drawYear; $(".ui-datepicker-calendar").find("tr > td").each(function() { $(this).click(function() { DP_jQuery.datepicker._selectDay(id,drawMonth,drawYear, this); }); });
Option Two: Adjust the above code around the onChangeMonthYear event. I'll let you figure it out.
comment:8 Changed 14 years ago by
Patch for jQuery UI 1.8: http://zetafleet.com/dev/jui/jquery.ui.datepicker.js.air-fix.patch
This patch is fully tested.
comment:9 Changed 14 years ago by
comment:10 Changed 13 years ago by
I am unable to verify this fix with latest rev 1.8 sources.
Built a bare-bones AIR app (using Aptana studio) with jquery-1.4.2.min.js and jquery-ui-1.8.min.js. Used the default demo code from JQuery website -
<script type="text/javascript"> $(function() { $("#datepicker").datepicker(); }); </script>
<p>Date: <input type="text" id="datepicker"></p>
The datepicker shows up on the input box but does not allow for selection of any date from the drop-down, the prev and next buttons do not work either. Tried listening to onSelect event for this datepicker and noticed that it never gets fired. Am i missing something?
comment:11 Changed 13 years ago by
The patch was not merged back into the trunk for whatever reason, so yeah, if you use the official source you will still not be able to use datepicker.
comment:12 Changed 13 years ago by
Priority: | blocker → major |
---|
comment:13 Changed 11 years ago by
The same underlying problem prevents datepicker from working on Google Sites' HTMLBox.
comment:14 Changed 11 years ago by
This commit enables all of the click and change events: https://github.com/metaweta/jquery-ui/commit/df77b43f08c593ed5a21323c02cc51b8ada37b02
comment:17 Changed 11 years ago by
Summary: | DatePicker does not respond to any click events in AIR → DatePicker does not respond to any click events in AIR, Google Sites, Windows Metro |
---|
comment:18 Changed 11 years ago by
Given the longstanding demand for this bug and the existence of a fix, can we get the status returned to blocker?
comment:19 Changed 11 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
Datepicker: Pulled event handlers into static code. Fixed #3945 - DatePicker does not respond to any click events in AIR, Google Sites, Windows Metro.
Changeset: 6dcc5c14c824ae9d653b1bc293680f6af6baf1b4
comment:20 Changed 11 years ago by
Datepicker: Pulled event handlers into static code. Fixed #3945 - DatePicker does not respond to any click events in AIR, Google Sites, Windows Metro. (cherry picked from commit 6dcc5c14c824ae9d653b1bc293680f6af6baf1b4)
Changeset: 831333a10aebad00b30d51cb274f463240c56814
comment:21 Changed 11 years ago by
Milestone: | 1.next → 1.8.22 |
---|
comment:23 Changed 10 years ago by
I didnt get the final solution How can I modify the date picker to be able to use click event. thanks
We're going to aim for full AIR support in 1.7.