Loading ...
Sorry, an error occurred while loading the content.

18960Re: calendar how-to's

Expand Messages
  • Satyen Desai
    Sep 29, 2007
    • 0 Attachment

      1). You should just be able to name your inline anonymous function, and use it be name...

      YAHOO.ex.cal.cal1.selectEvent.subscribe(function(event, args) {...});


      YAHOO.ex.cal.cal1.selectHandler = function(event, args) {...});

      (shortened names, just for readability. If you're doing all this inside a function, you don't really need to namespace everything, unless you need global access to it)

      NOTE: In your code you're not actually selecting all the dates in the week. You're just setting the visual presentation. If you really need the dates to be selected, the following example can provide some pointers.


      It was created to show how you can use Calendar's domEventMap to attach event listeners to row numbers, to select whole rows, but you can reuse the week selection logic in your non-row header use case also.

      2) .  The problem here probably stems from the fact that you're not really selecting the dates in your code  (as mentioned above). So methods like deselectAll() don't end up clearing out your cells which are just "visually" styled as selected.

      > cal1.selectEvent.unsubscribeAll();

      You probably don't want to call unsubscribeAll(), since this will remove any internal handlers the Calendar maybe using (or may use in the future) also.  Just unsubscribe the handlers you've added (see the API docs for CustomEvent).

      Hope that helps,
    • Show all 3 messages in this topic