Ticket 7602: Stop datepicker from appearing with beforeShow event handler #378

Closed
wants to merge 2 commits into
from

Conversation

Projects
None yet
3 participants

joekarl commented Jul 6, 2011

Small patch to allow stopping the datepicker from a beforeShow event handler.
Just checking to see if the return from the beforeShow handler is === false.
If it is === false then we return the same way as if the datepicker is disabled.

Also added demo page for this functionality.

$('#datepicker').datepicker({
    beforeShow: function(){
        return false; //will make datepicker not show
    }
});
Karl Kirch
Added ability to stop datepicker from beforeShow
Small patch to allow stopping the datepicker from a beforeShow event handler.
Just checking to see if the return from the beforeShow handler is === false.
If it is === false then we return the same way as if the datepicker is disabled.
Owner

gnarf commented Aug 3, 2011

You're trying to make the beforeShow event cancelable basically right? Can you perhaps make a ticket for this in the bug tracker? http://jqbug.com/ui/new

Owner

scottgonzalez commented Aug 3, 2011

This needs a unit test and the demo should be removed.

Karl Kirch
Added unit test for cancel show in beforeShow
Removed uneeded demo
Added test cases for before show returning false, truthy, and true

joekarl commented Aug 3, 2011

Demo removed and unit tests added.

joekarl commented Aug 3, 2011

Unit test is in tests/unit/datepicker/datepicker_tickets.js

Ticket 7602: Stop datepicker from appearing with beforeShow event handler (0, 3, 3)

Owner

scottgonzalez commented Aug 9, 2011

Thanks, landed in d146297.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment