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

Re: [ydn-javascript] Re: Adding a custom event to the event handling calendar

Expand Messages
  • Satyen Desai
    Can you provide an example of how you re trying to use it and we can look into it. Any errors? Thanks, Satyen ... From: chonlia To:
    Message 1 of 10 , Aug 30, 2007
    • 0 Attachment
      Can you provide an example of how you're trying to use it and we can look into it.
      Any errors?
       
      Thanks,
      Satyen

      ----- Original Message ----
      From: chonlia <juanluis.suarez@...>
      To: ydn-javascript@yahoogroups.com
      Sent: Wednesday, August 29, 2007 9:32:19 AM
      Subject: [ydn-javascript] Re: Adding a custom event to the event handling calendar

      Thanks a lot for your help.

      I'm trying to use "select" function, but don't works with a
      CalendarGroup. Why?

      --- In ydn-javascript@ yahoogroups. com, "Satyen Desai" <sdezzi@...>
      wrote:

      >
      > Hi,
      > Sorry about the delayed response. Some feedback below which may
      help.
      >
      > > My doubts:
      > > How to reset the calendar leaving the last date selected (using
      > > selectEvent) ?
      > >
      >
      > I don't fully understand how this will fit into your application,
      and
      > so maybe misunderstanding the question, but you can implement it in
      > your selectEvent listener by using the "selected" property of the
      > Calendar.
      >
      > var selectedDates = myCal.cfg.getProper ty("selected" );
      > // Work with a copy, just to be safe while you're looping
      >
      selectedDates = selectedDates. concat();
      >
      > This will give you the currently selected dates, in order of
      selection.
      >
      > You can then call Calendar.deselect( date) with all but the last
      date.
      > Something like the following:
      >
      > for (var i = 0; i < selectedDates. length-1; i++) {
      > // getDateFromArray is the function you already have on the
      page
      > var deselectDate = getDateFromArray( selectedDates[ i]);
      > myCal.deselect( deselectDate) ;
      > }
      > myCal.render( );
      >
      > See:
      >
      http://yuiblog. com/sandbox/ yui/v230/ examples/ calendar/ limitSelection. h
      t
      > ml for an example of this, but using the oldest selected date.
      >
      > > How to make a select of dates using two pages?
      > >
      >
      > At the least,
      you'll need extend your selection methods
      > (handleDblSelect) to work with the "pages" property of the
      > CalendarGroup. However since you're using Calendar.selectCell for
      > selection, this will not easily extend to use cases where the user
      > selects a start date in one month, clicks on the next button, and
      > selects a cell in another page.
      >
      > It's probably better to implement your dblClick selection using the
      > Calendar.select method - where you don't need to work with
      > cellIndices, and just work with Dates. That way you don't need to
      > worry about which dates are currently rendered, and which ones are
      > not. The only downside is that you need to call Calendar.render( )
      > after updating the selection, to see the changes which maybe a bit
      of
      > a performance hit.
      >
      > Hope that helps,
      > Satyen
      >
      > p.s. I believe I've mentioned
      this before, but in order to get
      > dblclick to truly work, you'll need to account for the fact that
      > Calendar's default single click handlers are also invoked during a
      > double click.
      >




      Take the Internet to Go: Yahoo!Go puts the Internet in your pocket: mail, news, photos & more.
    Your message has been successfully submitted and would be delivered to recipients shortly.