Skip to content

problems when attached to a div #120

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
barhorn opened this issue Mar 7, 2011 · 0 comments
Open

problems when attached to a div #120

barhorn opened this issue Mar 7, 2011 · 0 comments

Comments

@barhorn
Copy link

barhorn commented Mar 7, 2011

I found a couple of issues when it is attached to a div instead of an input:

Here's how I'm instantiating it:

$(document.body).append($('<div/>').attr('id','time_wheel_clock_settime').css({position:'absolute',right:'.6em',bottom:$('#time_wheel_clock').height(),zIndex:500}));

$('#time_wheel_clock_settime').datetimepicker({
                                showAnim: 'slide',
                                showOptions: { direction: 'down' },
                                ampm: true,
                                changeMonth: true,
                                changeYear: true,
                                stepMinute: 15,
                                hourGrid: 6,
                                minuteGrid: 15,
                                onSelect: function(dateText, inst) {
                                          that.setClockDateTime(new Date(dateText));
                                }
                              });

I'm toggling the display of the date/time picker from a jquery UI button. However, when I change the date, the Done button appears. Not the end of the world, but it doesn't do anything. I just add the following to make it hide the display as I'd like:

$('.ui-datepicker-close','#time_wheel_clock_settime .ui-datepicker-buttonpane').live('click',function() {
    $('#time_wheel_clock_settime .ui-datepicker').hide('slide',{direction: 'down'}, 'slow');
});

This works fine for the done button, but the "Now" button also has issues that aren't as easily resolved. It changes the date/time correctly on the display, but my onSelect function never gets called.

Is there a workaround for this? Is it that I'm doing something incorrectly? I've tried the following, but it doesn't seem to make a difference:

$('.ui-datepicker-current','#time_wheel_clock_settime .ui-datepicker-buttonpane').live('mouseup',function() {
    $('.ui_tpicker_hour .ui-slider-handle','#time_wheel_clock_settime   .ui-datepicker').trigger('click');
    $('div#time_wheel_clock_settime.hasDatepicker').trigger('change');
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant