jQuery UI has a widget called accordion. It's easier to show than explain, so here's my fiddle:
What a novel way to display the data, right? The other jQuery object we used was the template plugin, currently in beta. It allows you to create a markup template using a special kind of variable; this way, I was able to translate the data from our external js file through a template and create all this content with very little markup.
The final touches I added were a small amount of javascript to make the data a little more useable. For one, I used the date object to calculate the age of the individuals displayed. Pretty simple.
The second was to create a sort method to display them alphabetically by last name and then my first (should there be common last names, which there are in this data set). To do this, I used a special thing called a ternary operator, which by the way, is my new favourite thing. I fell in love with the ternary operator the moment I saw it; it's a succinct, elegant flow control that tests a boolean and goes one of two ways down your program. The neat thing, is that you can nest them, which I did threefold in my script. It could therefore be used as an alternative to a small switch statement, which (apparently) are pretty faux pas these days.
I'll probably get some flak for nesting that many. It borders on unreadable and thus difficult to maintain, but at this point I don't care. Something about stacking if statements makes me cringe. Here's an example:
return (boolean) ? true : falseNested...
return (boolean) ? true : ((another_boolean) ? true : false))Cool, right? I think that ternary operators and I will be pretty good friends for a long time.
All the latin in the "Notes" section of the data reminds me of the episode of The West Wing that Amy and I watched last night, which is my favourite episode in the whole series: Two Cathedrals. Now I have a script that is just like Martin Sheet calling you a feckless thug over and over via template!

