YUI: Problem with using a loop to addRenderer on CalendarGroup

I'm trying to use the Calendar component in the YUI toolkit.

I've got a calendar group, and I want to mark certain dates as
unavailable. Eventually, the set of unavailable dates will come from the server, but for now I'm just instantiating an array with some dates in.

I have a custom renderer as per the examples on developer.yahoo.com which I want to apply to all the dates in the array. Currently I have this code:

var i=0;
while (i < bookedDates.length()) {
YAHOO.swg.calendar.cal2.addRenderer(bookedDates[i], swgBookedRenderer);
i++;
};

Originally it was a for loop, but the effect is the same for either.
The problem is, with this code the calendar doesn't render. In
Firebug as I set through it leaps directly from 'while(i...' to line 8
of yahoo-dom-event.js and never actually executes the code. If I write out addRendered lines in full then everything works. I've put up an example page with both versions of the code, you'll see that only one calendar renders:

http://www.serviceworksglobal.com/questionnaire/test.html

I'm assuming there's something important I don't know about loops and YUI event handling, can anyone explain to me what it might be?


Would you like to answer or comment?

Sign up for a free account, or sign in (if you're already a member).
  • 732 views
Share Send to a friend Watch Report
 
 

Posted Answers

 

Satyen pointed out my code error on the

ydn-javascript list, he also posted a fixed version of my code. It was me being dumb - should be buildDate.length not buildDate.length()

Posted 1 year ago ( permalink )
Rated as
#1 out of 1
0
0

Helpful?

line
line
line



Sign in to participate

Got an answer for robertc? Would you like to comment on the posted answers, or vote for the one which you think is the best?

Sign up for a free account, or sign in (if you're already a member).

Explore Related Questions

Other people asked questions on similar topics, check out the answers they received:


What is web 2.0?

What is web 2.0?
Submitted by hc1 1 year ago
  • viewed 770 times

Last answer posted 10 months ago by JohnScottDixon


What does web 2.0 really mean?

What does web 2.0 really mean?
Submitted by JessJones 1 year ago
  • viewed 836 times

Last answer posted 10 months ago by joel555


Web2.0

What is the Web2.0 , Does it have a future ? Which way can we go ?
Submitted by henryshi001 2 years ago
  • viewed 1963 times

Last answer posted 5 months ago by YeddaYogi



» More...

Feed - Subscribe to changes to this Q&A Blog

Explore Related Videos

Interview with Nwokedi Idika - eSposure.com

Midterm video interview with Nwokedi Idika for ENTR200 (Intro to Entrepreneurship & Innovation) @ Purdue University. *** Nwokei is a Ph.D. student in Computer Science at Purdue University in West Lafayette, IN. He obtained his B.S. in Computer Science from the University of Maryland, Baltimore County and his M.S. in Computer Science from Purdue University. Nwokedi is the founder of eSposure.com (www.eSposure.com) - a video trade show Web site for small businesses that can't afford the cost of setting up a display at a national trade event within their industry. Nwokedi is also in the process of starting Innovate Indiana (innovateindiana.biz) - a social gathering of entrepreneurs and investors. Nwokedi's blog: http://how2livelife.blogspot.com/ eSposure.com blog: http://esposure.com/blog/ *** Filmed and Produced By: ENTR200 - Team 4 Karthik Rajendran Jeff Ealy Megan Ellis Zach Udchitz Filmed: 02/28 @ Purdue University, West Lafayette, IN Original Time: 36:32:01

Nuesion Web Development Video: Email...

http://www.nuesion.com Call 800-870-3721 Nuesion: Houston Web Development - We discuss the benefits of Email Auto-Responders for your web site. Jerry Villarreal breaks down an example from a client site on a simple and effective email auto-responder.

meetup-webstandards-microformats-2007-09-11

Eric Meyer speaks about microformats at the Cleveland Area Web Standards Meet Up . Held at Tri-C on September 11th, 2007.

Social bookmarking with Drupal

Watch the original screencast here This screencast provides a 12 minutes overview of the Digg this and Service links modules.

web development, suncoast internet, web...

http://www.suncoastinternet.com.au These dudes will do your web development and you won't find a better business to work with. The guys are a bit ugly but they do a damn good job (joking about the ugly thing guys)

Windows Development Tutorial - Making a Web...

http://www.tom-rogers.com/ - At the end of the last tutorial we'd added a "Stop" and "Refresh" button to our web browser. In this video we will add "Home" and search buttons.

Web Development - Mahalo.com will FAIL -...

http://www.BannerBlindness.com

Shining Stars Development Promo

An overview of the development that we did for the Shining Stars site

Building Web applications with Visual...

Sponsored: Find out how ASP.NET 2.0 can help you build Web applications quickly. Asli Bilgin, Developer Evangelist on Microsoft's National Architecture Team, reviews the key architectural features in ASP.NET 2.0 and explains how you can make them work for you. The content for this video was sponsored and provided by Microsoft.

Byte Club - Ep5 - Devlin

www.byteclub.tv Byte Club visits Devlin eBusiness Architects to discover meet their web development team and learn about how they use video conferencing to bridge the distance gap.
» More...
Powered by
Copyright © 2006-2008, Yedda Inc. and respective copyright owners · CC License