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

RE: [ydn-javascript] Next and Previous buttons on Calendar2Up

Expand Messages
  • Steven Peterson
    You can put the links anywhere that you want to. The email you sent before says you want them to be placed outside of the Calendar. If you want to place them
    Message 1 of 4 , Mar 27 10:59 AM
    • 0 Attachment

      You can put the links anywhere that you want to. The email you sent before says you want them to be placed outside of the Calendar. If you want to place them inside the CalendarGroup, but outside the individual Calendars, simply modify YAHOO.widget.Calendar2up_Cal.prototype.renderHeader function in order to see how the Calendar2up goes about placing the back link on the left, and the next link on the right.

       

      Steven Peterson

      Web Developer, Platform Engineering

      Yahoo!


      From: ydn-javascript@yahoogroups.com [mailto: ydn-javascript@yahoogroups.com ] On Behalf Of Cecil Vermule
      Sent: Monday, March 27, 2006 9:36 AM
      To: ydn-javascript@yahoogroups.com
      Subject: Re: [ydn-javascript] Next and Previous buttons on Calendar2Up

       

      I figured the renderHeader() part out, but I was unsure of where to actually put the links.  I want the links to appear on the respectful sides of the CalendarGroup. 

      On 3/24/06, Steven Peterson <peterson@...> wrote:

      If you'd like to move the next/previous buttons outside of the Calendar, you should first override your instance of Calendar to not display the buttons built-in, like so (where myCalendar is the variable name of your calendar):

       

      myCalendar.renderHeader = function() {

            this.headerCell.innerHTML = "";

           

            var headerContainer = document.createElement("DIV");

            headerContainer.className = this.Style.CSS_HEADER;

       

            headerContainer.appendChild(document.createTextNode(this.buildMonthLabel()));

            this.headerCell.appendChild(headerContainer);

      };

       

      This will make it so that the next/back links are not rendered. If you notice, this function that you're overriding does not include the links, like Calendar.js does by default.

       

      As for using the Event utility, if you have links where you want to put next/back functionality, assuming their IDs are "next" and "back", you would write that code like this:

       

      YAHOO.util.Event.addListener("next", "click", myCalendar.nextMonth, myCalendar, true);

      YAHOO.util.Event.addListener("back", "click", myCalendar.previousMonth, myCalendar, true);

       

      This should achieve what you want it to. It's attaching the Calendar's nextMonth / previousMonth to the next/back links and correcting the scope to the Calendar's scope.

       

      If you have any more questions, please let me know!

       

      Steven Peterson

      Web Developer, Platform Engineering

      Yahoo!


      From: ydn-javascript@yahoogroups.com [mailto:ydn-javascript@yahoogroups.com] On Behalf Of Cecil
      Sent: Friday, March 24, 2006 11:01 AM
      To: ydn-javascript@yahoogroups.com
      Subject: [ydn-javascript] Next and Previous buttons on Calendar2Up

       

      I want to move the next/previous buttons to be outside of the calendar
      without using the absolute positioning.

      Can someone show me how to do this?  I can get the images to render.
      That's not the problem, it's primarily with the
      YAHOO.util.Event.addListener().  The third parameter is the function
      you want to call and the forth parameter in the current code is the
      parent.

      I want to know what to use and where to put the OBJECTNAME.appendChild
      () methods.

      Any help is much appreciated.
      Thanx!



       

      SPONSORED LINKS

      C programming language

      Computer programming languages

      Java programming language

      The c programming language

      C programming language

      Concept of programming language

       


      YAHOO! GROUPS LINKS

       

      ·   To unsubscribe from this group, send an email to:
        ydn-javascript-unsubscribe@yahoogroups.com
       

      ·   Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.

       




    Your message has been successfully submitted and would be delivered to recipients shortly.