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

18989Re: calendar how-to's

Expand Messages
  • larhire
    Oct 1 12:10 AM
    • 0 Attachment

      Thanks for your answer.

      For 1, I did try to do what you suggested but found that it simply
      refused to work, namespace or no namespace (I did work around this in
      the end). I'm not selecting all the dates because I don't really need
      to do it as the jsp behind just handles all that. Just needed the
      visual selection (the example you mention helped me a lot).

      For 2, after some more digging through this great group (seriously), I
      managed to understand what I was doing wrong with the renderers so I
      just started again. I ended up with an if-clause in the calendar
      select handler that changes the rendering type depending on the tab
      and this works fine. The next step will be extending the calendar
      class to handle selection, as it seems to be a somewhat better approach.

      Will post here when ready.

      Thanks again for your answer,


      --- In ydn-javascript@yahoogroups.com, "Satyen Desai" <sdesai@...> wrote:
      > Hi,
      > 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) {...});
      > becomes:
      > 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.
      > l
      > 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,
      > Satyen
    • Show all 3 messages in this topic