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?
Satyen pointed out my code error on the
i dont anderstand what your asking?
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).
Other people asked questions on similar topics, check out the answers they received:
Other people asked questions on various topics, and are still waiting for answer. Would be great if you can take a sec and answer them