The datePicker() function is attached to $("#rangeDatepicker"), the
outer-container, not the div containing the day numeral or whatever
is  clicked in the pop-up calendar dialog.

You could declare a var that remains in-scope and embodies the
container.  For example
  var $rangeDatePicker= $("#rangeDatepicker");
   $rangeDatePicker.datepicker(....)

Then, in the onSelect callback, refer to $rangeDatePicker.

This will work.  As with most things, there may be other ways of doing
this.

**--**  Steve


On Oct 29, 7:40 am, Gianluca <gianluca.pi...@allbus.com> wrote:
> Hi all,
>
> i'm using jQuery UI Datapicker, and i have a problem
>
> this is mi code:
>
> $(document).ready(function()
> {
>         $("#rangeDatepicker").datepicker(
>                 {
>                         numberOfMonths: [3, 4],
>                         onSelect:function(date, inst){
>                                 alert($(inst).datepicker('getDate'));
>                                 //alert($(this).datepicker
> ('getDate'));
>                         }
>                 }
>         );
> $("#rangeDatepicker").datepicker("setDate",new Date(2009, 1-1, 1));
>
> });
>
> When the page is ready the datepicker is displayed correctly, and date
> is setted at 2009-01-01: all works.
>
> But cliccking on a day, i recive an error from firebug: "$
> (inst).datepicker is not a function"
> (or "$(this).datepicker is not a function" if i use this).
> And i don't understand WHY??
>
> What i wanna do is to modify option of datapicker on the event
> onSelect. But i can't because it doesn't find the
> function .datapicker.
>
> Somebody can help me, please ??
>
> Thanks

--

You received this message because you are subscribed to the Google Groups 
"jQuery UI" group.
To post to this group, send email to jquery...@googlegroups.com.
To unsubscribe from this group, send email to 
jquery-ui+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/jquery-ui?hl=en.


Reply via email to