forked from chrisekelley/coconut
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
implementation of jQuery deferreds for views in Home page charts.
- Loading branch information
1 parent
4e29a20
commit 6a13e9a
Showing
9 changed files
with
9,172 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
var Report = Backbone.Model.extend({ | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
var ReportCollection = Backbone.Collection.extend({ | ||
model: Report, | ||
//url: '/reportElements', | ||
// initialize: function(){ | ||
// // Assign the Deferred issued by fetch() to the Collection | ||
// this.deferred = this.fetch(); | ||
// }, | ||
db : { | ||
view: "byDepartmentEducation?reduce=true&group_level=2", | ||
keys: null, | ||
}, | ||
parse: function(response) { | ||
console.log("parse:" + JSON.stringify(response)); | ||
return response; | ||
}, | ||
initialize: function(){ | ||
// Assign the Deferred issued by fetch() to the Collection | ||
console.log("ReportCollection init."); | ||
this.deferred = this.fetch({ | ||
success : function(countData){ | ||
FORMY.Report = countData; | ||
console.log("Report count: " + FORMY.Report.length); | ||
console.log("this from ReportCollection init: " + JSON.stringify(this.deferred)); | ||
}, | ||
error : function(){ | ||
console.log("Error loading Report: " + arguments); | ||
} | ||
}); | ||
console.log("ReportCollection deferred."); | ||
//this.deferred = this.fetch(); | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.