Issue 912: Callback, after all events are drawn
Status:  Duplicate
Merged:  issue 753
Owner: ----
Closed:  May 2011
Reported by idbill.p...@gmail.com, Apr 14, 2011
Currently, I'm updating a checkbox tree based on the events displayed.

The update occurs after each event, when it would be more efficient to update the tree AFTER all the events are displayed.
Apr 15, 2011
#1 p.stud...@gmail.com
use the loading callback?

.
.
loading: function(bool) { if (bool) $('#tree').show(); else $('#tree').hide();  },
.
.
?
This will fire once everything has been loaded.. all streams.. etc.
Apr 15, 2011
#2 idbill.p...@gmail.com
Good to know.. but it appears, loaded is called before the JSON call is complete... which makes sense since the JSON call is asynchronous. The way I was doing it is working, but the checkboxTree appears to be the real culprit.

Is there a way to get the start/end time directly from the calendar? (instead of using a temporary variable)

PS. IMHO, You should link your answers to your docs.. that forces people to look at them and bookmark them when desired.

Here is my calendar code:

 calendar = $('#calendar').fullCalendar({
            // put your options and callbacks here
            editable: false,
            events: function( start, end, callback ) {
                cal_start = start;
                cal_end = end;

                $.getJSON( "/conference/calendar/",
                          { start: Math.round( Math.round( start.getTime() / 1000 ) ),
                            end: Math.round( Math.round( end.getTime() / 1000 ) ),
                            regions: getSelectedRegions(),
                            verticals: getSelectedVerticals(),
                            search: getSearchTerms(), },
                    function( json ){
                        if ( json != null ) {
                            callback( json );
                            if ( json.length > 0 ) {
                                check_regions( json[0].regions );
                                check_industries( json[0].industries );
                                expand_industries( json[0].top );
                            } else {
                                check_regions( new Array() );
                                check_industries( new Array() );
                                tree.collapseAll();
                            }
                        }
                    })
                }
            }
        });

Apr 18, 2011
#3 p.stud...@gmail.com
Strange "loading" fires once all feeds have been rendered on my side.

$('#calendar').fullCalendar({
                 header: {
                     left: 'today',
                     center: 'prev,title,next',
                     right: 'month,basicDay'
                 },
                 allDayDefault : true,
                 loading: function(bool) { if (bool) $('#loadingImg').show(); else $('#loadingImg').hide();  },
				 eventSources: [<%= initialSource%>]
				 
				 });
				 
				 And my initial sources are dynamic, including gcals. I can have up to 7 sources... and untill all are loaded then the loading button will no go away.
				 If nothing is loaded then the loading button also does not go away (defect i suppose)
				 If one fails it ignores it and will load the rest.
May 8, 2011
Project Member #4 adamrs...@gmail.com
(No comment was entered for this change.)
Status: Duplicate
Mergedinto: 753