Created
December 9, 2009 22:26
-
-
Save hojberg/252896 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
// Simplified example | |
App.Controllers.Sales = Object.create(App.Controllers.Master, { | |
all: function () { | |
// Find all method on Sale initiates a callback when data has returnes | |
App.Models.Sale.findAll(function () { | |
// render method on $ initiate a callback when the template has been loaded in the dom | |
$('contentarea').render("sales/all", function (sales) { | |
// Pure template autoRender method finds some id and auto loops over and array | |
$('#id-of-a-list-of-sales').autoRender(sales); | |
}); | |
}); | |
} | |
}); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment