$('body').click function is working before Datepicker (jquery) beforeShow method
Dmlcskn’s Question:
$(‘body’).click function is working before Datepicker (jquery) beforeShow method.
How can I trigger first onselect method of Datepicker (jquery). I mean
$('body').click(function (evt) {
// do something
}
$('#UxDatePickerFrom').datetimepicker({
beforeShow: function (inst) {
// do something on select
})
but if I select datepicker , body click is working first which is unwanted.
$('body').click();
is a global click handler for all the elements with it, so where ever you click on the body or on the date picker the function will execute.
Your solution is to change the click handler to affect more specialized group of elements and not all of it.
$("#yourspecificelement").click(function() {
// ....
});