viernes, 16 de octubre de 2015

Datepicker JQuery autoclose no funciona... Solución :)

Si estas utilizando el plugin jquery UI "Datepicker" y defines el parámetro autoclose = true y aun asi no se cierrar al momento que seleccionas la fecha acá te va el código para darle solución:


 $("#FechaRegistro").datepicker({
                showOtherMonths: true,
                selectOtherMonths: false,
                autoclose: true,
                format: "dd/mm/yyyy",
                language: "es"
            }).on('changeDate', function(ev) {
                $(this).datepicker('hide');
                $("#cantidad").select();
            }); 

Es necesario definir en el evento changeDate que se oculte con la siguiente instrucción:
$(this).datepicker('hide');


No hay comentarios.: