Jquery DatePicker is not working after partial postback.

Hello,

Sometimes after partial post back, datepicker do not work as accepted.

The problem is we require to re-initialize it after partial post back is completed.

In my application I have solved above problem by below code.


Sys.WebForms.PageRequestManager.getInstance().add_endRequest event
"Raised after an asynchronous postback is finished and control has been returned to the browser."


 $(document).ready(function() {
            Sys.WebForms.PageRequestManager.getInstance().add_endRequest(EndRequestHandler);

            function EndRequestHandler(sender, args) {
                  $(".date-picker").datepicker({
                            changeMonth: true,
                            changeYear: true,
                            showButtonPanel: true,
                            showOtherMonths: true,
                            selectOtherMonths: true
                        });

            }


Above solution is work fine for me. However I have observed there are many other problem for this.solution may different in that case.


Posted in |

0 comments:

Post a Comment