Issue 130: Problem using local array as source
Status:  Done
Owner: ----
Closed:  Nov 2009
Reported by romynpg, Oct 16, 2009
Hi Adam,

I'm the person who recently contacted you as to the best place to post a
problem I have - and you pointed me here. Thank you and thanks also for a
great plugin!

This is neither a enhancement request or a bug but more a failure on my
part to understand something.

My aim is to load the calendar from a local array - I already have the data
so don't want to set the Events source as a json php page - however I can't
seem to get it work.

Where I'm getting stuck is illustrated on the following test page
http://www.thekmz.co.uk/GEPlugin/wip/test/cal_test1/cal_test1.htm

Calendar1 is just a basic one in which I add an event in the same way as
the basic example.

Calendar2 adds the event with a simple (non-json) array. This displays ok
but is probably not the way to do it as when I look at the array in FireBug
it looks strange and the source seems to keep repeating itself.

Calendar3 uses a json source (array converted to json using the jquery json
plugin). While this looks ok in FireBug the event isn't displayed in the
calendar. 

The pop-up alert when loading the page is the json array for calendar3 -
just to check what is. The start date is enclosed in ""s but I'd tried a
previous version of the json plugin which doesn't do that but got the same
results.

Hopefully someone will be able to point out what I'm doing wrong - I'm sure
it's simple and I'm just being a bit of a numpty.

Thanks in advance
Romyn

Oct 29, 2009
#1 romynpg
Hi,

I still seem to be having trouble with and, because I haven't seem anyone else with
issues, I'm assuming I'm doing something wrong?

Here's an even simpler example
http://www.thekmz.co.uk/GEPlugin/wip/test/cal_test1/cal_test2.htm

... and while it seems to work (render the event) in the 2nd calendar - in my real
app, which has a couple of dozen events constructed in a similar manner from another
array, a friend testing it is reporting that it can take up the 10 secs to show the
events.

The thing that puzzles me is when looking in Firebug the events_cal2 array has a
Source that infinitly repeats itself as you drill down within it. Is that right? and
if not what am I doing wrong.

Thanks and regards
Romyn
Oct 29, 2009
Project Member #2 adamrs...@gmail.com
Hello Romyn,
I am sorry I have taken so long to get back to you. Let me first address the problem
in your first post, of Calendar 3 not displaying events:

you are converting a javascript array into a json string, and then passing it to
fullcalendar. fullcalendar only accepts a javascript array OR a string that is a
*URL* to a json file/feed, so this won't work.

In your second post you talk about the events array infinitely repeating (when you
console.log it after the calendar initializes i assume). i imagine you are drilling
down into the _source property. this contains a reference to the parent array itself,
so it will inevitably recurse into itself. this is not an issue.

taking 10 seconds to display events on the calendar does sound like an issue though,
especially if the events come from a static javascript array when the page loads. if
this continues to be an issue, can you isolate the problem in an example, and then
post it to this thread? thanks.
Nov 10, 2009
Project Member #3 adamrs...@gmail.com
respond to this thread if anything mentioned is still in issue for you. i am closing
it for  now
Status: Done