yes thanks thats i wanted to know... that destroy is the only
possibility...
the above example was a bad example...

in real i have a checkbox and an input with the date button.

if (checkbox.checked)

$("#datepicker").datepicker({
                showOn: 'button',
                buttonImage: 'templates/images/calendar.gif',
                buttonImageOnly: true

else

destroy datepicker

i thought i could use bind/unbind and a function...
in which i for example unbind datepicker() from $("#datepicker")...

but destroy works as well...

thanks stephan

On Feb 4, 10:12 pm, Stephan Veigl <[email protected]> wrote:
> I still don't get what you really want to do.
>
> Once you click on your #load element, you attach a datepicker to your
> input. Unbinding the click event from the #load element will just
> disable the load trigger, but the datepicker is still attached to the
> input element. To detach a UI element use: datepicker("destroy").
>
> by(e)
> Stephan
>
> 2009/2/4 mcologne <[email protected]>:
>
>
>
> > upps there was an error:
>
> > unload is just an eventhandler to unbind #load
>
> > $(#unload).click(function() {
> >      $("#load").unbind('click', loadfn)
> > });
>
> > but this doesn't work
> > On Feb 4, 8:53 pm, mcologne <[email protected]> wrote:
> >> hi,
>
> >> i'm not sure how to unbind a datepicker...
>
> >> html is:
> >> <p>Date: <input type="text" id="datepicker"></p>
> >> <a href="#" id="load">load datepicker</a><br />
> >> <a href="#" id="unload">unload datepicker</a><br />
>
> >> javascript:
> >> $(document).ready(function() {
> >>         var loadfn = function () {
> >>                 $("#datepicker").datepicker({
> >>                 showOn: 'button',
> >>                 buttonImage: 'templates/images/calendar.gif',
> >>                 buttonImageOnly: true
> >>                 });
> >>         };
> >>         $("#load").click(loadfn);
>
> >> });
>
> >> is there a possibility to use something like
> >> $("#unload").unbind('click', unloadfn) ?
>
> >> how looks this function like?
> >> or must i use datepicker( "disable" )?
>
> >> best regards m
> >> cologne
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"jQuery UI" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/jquery-ui?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to