One of the projects I am currently working on involves a booking calendar, that displays dates, availability and rates for vacation rental properties.
I wanted each day in the calendar to contain quite a bit of information about its availability. Some dates are only available as a "block" for example weekly. Blocks can have a fixed arrival date, (Friday) each date would have a minimum stay etc etc.. you get the point. I started off using class to store all this information class="blockid33 minday7 arivalFriday" I really dont like this idea as class should really be used for visual information... And to get to that data in the class-names, I have to strip out the "blockid" or "minday" Since XHTML lets me define custom attributes, that seems the better way to go... I would have each day in my calendar as a div <div id="YYYY-MM-DD" blockid="33" minstay="7" arrival="friday" class="booked">DD</div> This way I can have all my data on hand quickly and easily. I found a great article talking about just this issue and suggesting some modifications to prototype with document.getEllementsByAttribute and some changes to Enumerables to have access to custom attributes.. http://unspace.ca/discover/attributes This all seems to make a lot of sense to me. Has there been any other discussion of this sort of functionality making it into prototype.js? Cheers. ______________________________________________________________________ Alex Duffield ❖ Principal ❖ InControl Solutions . http:// www.incontrolsolutions.com --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
