I really like the idea.  I'm planning on doing something similar with
statistics for a variety of categories, and would like to experiment with
this.  I'd be interested to see any snippets of code you want to share, and
likewise, I'll share mine.

Can you explain your point about "class should really be used for visual
information"?  If you are speaking of a JS pseudo class, I'm not sure I'm
convinced that's true, but would like to hear what you mean.

What about storing the data in a js object that represented a date and all
of your calendar properties for that date?  (You could then obviously set
the prototype for that object to contain the methods related to changing
these properties, etc.)  This way, you could retrieve sets of data from the
server during Ajax calls during events, then populate these JS objects via
JSON callbacks.  It would also enable you to use PeriodicalUpdater to
populate dates that had been updated by other users since the last time you
loaded your page.  As the user changed certain properties (E.g. weekly view,
instead of monthly view, for instance), the Ajax request would populate
those set of "day" objects accordingly.   I suppose you would be doing the
same thing by placing these values into the custom HTML, but it would seem
that would be slower than staying in native JS.  But I do not know that for
a fact.

Not sure if that works in the context of what you're doing, but figured I'd
throw it out there for thought.


On 6/7/07, Alex Duffield <[EMAIL PROTECTED]> wrote:
>
> 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* <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
-~----------~----~----~----~------~----~------~--~---

Reply via email to