Wednesday, May 9, 2012

Set focus on selection of date from jQuery datepicker to control it self


Following is the jQuery code to set focus on control after selecting the date from the jQuery Date Picker

jQuery.extend(jQuery.datepicker, { afterShow: function (event) {
    jQuery.datepicker._getInst(event.target).dpDiv.css('z-index', 99999999);
}
});

jQuery(function(){
    $("#divGameQuestionPanel [datepicker]").datepicker({
        changeMonth: true,
        changeYear: true,
        yearRange: 'c-99:c+0',
        showOn: "button",
        buttonImage: calImageSrc,
        buttonImageOnly: true,
        dateFormat: 'dd/mm/yy',
        onSelect: function (dateText, inst) { $(this).focus(); }
    }).focus(function (event) {
        jQuery.datepicker.afterShow(event);
    });
});

Developer must have Browser Addons list

Google Chrom

1) Chrome - use full to select color and its different sades

https://chrome.google.com/webstore/detail/gefgglgjdlddcpcapigheknbacbmmggp

Live website to use it without add into the browser

http://lucumalabs.com/chroma