Great David that was just the help I needed! Sewing your input with
the TimeGrid example code, I was able to whittle it down to the
following:
<html>
<head>
<title>Timegrid</title>
<script
src="http://static.simile.mit.edu/exhibit/api-2.0/exhibit-
api.js?autoCreate=false" type="text/javascript"></script>
<script>
window.jQuery = SimileAjax.jQuery;
window.$ = SimileAjax.jQuery;
</script>
<script src="http://static.simile.mit.edu/timegrid/api/
timegrid-api.js" type="text/javascript"></script>
<script language="JavaScript">
var anEventSource;
var aTimegrid;
function onLoad()
{
anEventSource = new Timegrid.DefaultEventSource();
aTimegrid =
Timegrid.createFromDOM(document.getElementById("some-
div"));
Timegrid.loadJSON("timegrid.json",
function(json, url)
{
anEventSource.loadJSON(json, url);
}
);
}
</script>
</head>
<body onload="onLoad();">
<div id="some-div"
tg:role="grid"
tg:views="week"
tg:eventSource="anEventSource"
tg:dayStart="0"
tg:dayEnd="24"
tg:yCell="20">
</div>
</body>
</html>
For the most part, seems to work with some seed data on either IE 7.0,
FF 3.0, or Safari 3.2 on WinXP. I see a gray background on Feb 9th
(presumably representing today's date). Also, may just be a bug, I
see a gray bar at 8pm row (for all dates) once I have scrolled forward
to today's date.
Not sure if you know, but what are the other "tg:" name-value pairs?
Thanks again for getting me kick-started with this (and all the other)
excellent SIMILE widgets.
-Mark
On Jan 28, 7:26 pm, David Huynh <[email protected]> wrote:
> mledenwrote:
> > I understand that Timegrid is no longer supported. However, it's *SO*
> > close to what I need :-)
>
> > David, the "MIT Course Picker" doesn't appear to use any JSON file
> > whatsoever. However, looking at the legacy Timegrid documentation on
> > the MIT wiki, it looks like that was the original intent. Is it
> > possible to bootstrap Timegrid (with the JQuery "workaround" you
> > mention) *and* get the data from JSON? If so, would it be possible
> > for you to outline what scripts and syntax I'd need in the <head> tags
> > and the syntax for the <body> (assuming the JSON syntax remains as it
> > was)? If I can get this to work in the short term, I might be able to
> > invest some time into resurrecting Timegrid itself.
>
> I believe Timegrid works pretty much like Timeline, so I'd expect
> something like this to work, from digging around in picker:
>
> var anEventSource;
> var aTimegrid;
> function onLoad() {
> anEventSource = new Timegrid.DefaultEventSource();
> aTimegrid =
> Timegrid.createFromDOM(document.getElementById("some-div"));
>
> Timegrid.loadJSON(
> jsonUrl,
> function(json, url) {
> anEventSource.loadJSON(json, url);
> }
> );
> }
>
> And in the HTML file
>
> <div id="some-div" tg:role="grid"
> tg:views="week" tg:eventSource="anEventSource"
> tg:dayStart="8" tg:dayEnd="22"
> tg:yCell="100"></div>
>
> David
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"SIMILE Widgets" 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/simile-widgets?hl=en
-~----------~----~----~----~------~----~------~--~---