Skip to content

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

Closed
joekarl wants to merge 2 commits intojquery:masterfrom
joekarl:master
Closed

Ticket 7602: Stop datepicker from appearing with beforeShow event handler #378
joekarl wants to merge 2 commits intojquery:masterfrom
joekarl:master

Conversation

@joekarl
Copy link

@joekarl 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
    }
});

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.
@gnarf
Copy link
Member

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

@joekarl
Copy link
Author

joekarl commented Aug 3, 2011

Created a ticket. http://bugs.jqueryui.com/ticket/7602

@scottgonzalez
Copy link
Member

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

Removed uneeded demo
Added test cases for before show returning false, truthy, and true
@joekarl
Copy link
Author

joekarl commented Aug 3, 2011

Demo removed and unit tests added.

@joekarl
Copy link
Author

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)

@scottgonzalez
Copy link
Member

Thanks, landed in d146297.

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

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants