Last active
November 9, 2016 22:12
-
-
Save jasonday/536b95093acf3f780e299e851ec5efd9 to your computer and use it in GitHub Desktop.
jQuery UI Datepicker displayed in a jQuery Dialog
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ui-datepicker-div { | |
position: relative !important; | |
top: 0 !important; | |
left: 0 !important; | |
padding: 0; | |
display: block !important; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$("#field").datepicker({ | |
showOn: "button", | |
buttonText: "day", | |
beforeShow: dialogFx, | |
onSelect: dialogFxClose | |
}); | |
function dialogFx() { | |
$('#ui-datepicker-div').dialog({ | |
minHeight: 250, | |
modal: true, | |
open: function() { | |
setTimeout(function() { | |
$('#ui-datepicker-div').find('.ui-state-highlight').focus(); | |
}, 50); | |
} | |
}); | |
} | |
function dialogFxClose() { | |
$('#ui-datepicker-div').dialog('close'); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment