jquery - ui date picker close if click on next -


i'm using jquery ui datepicker plugin (http://www.kindli.ch). unfortunately if click next or prev-icon, hole calendar change , close immediately. jquery updated, ui datepicker newest version.

my code:

if($('input#datepicker_arr').length) {                       $('#datepicker_arr').datepicker({                         dateformat: 'dd.mm.yy',                         monthnames: ['januar','februar','märz','april','mai','juni','juli','august','september','oktober','november','dezember'],                         daynames: ['sonntag', 'montag', 'dienstag', 'mittwoch', 'donnerstag', 'freitag','samstag'],                         daynamesmin: ['so', 'mo', 'di', 'mi', 'do', 'fr', 'sa'],                         numberofmonths: 3,                        });                     } 

thanks help.

best regards thomas

the issue due click event handler on document,

$(document).click(function (e) {      var target = e.target;      if (!$(target).is('.hasdatepicker')) $(".hasdatepicker").datepicker("hide");  }); 

so, here have checked $(target).is('.hasdatepicker') , hasdatepicker class present on input not datepicker panel.

see image detail : enter image description here

so, achieve similar functionality use following instead ,

 $(document).click(function (e) {      var target = e.target;      //if input nothing      if ($(target).is('.hasdatepicker')) return true;      //if current element has parent called ui-datepicker-div nothing      if (!$(this).closest('.ui-datepicker-div'))              $(".hasdatepicker").datepicker("hide");  }); 

see working demo


Comments

Popular posts from this blog

yii2 - Yii 2 Running a Cron in the basic template -

asp.net - 'System.Web.HttpContext' does not contain a definition for 'GetOwinContext' Mystery -

mercurial graft feature, can it copy? -