I did a small part of the introductory training manual (including Absolute Beginners, study it in full , as well as large parts of the 2nd school of codes Main courses), and I can fully see the potential that Backbone offers. But the light of understanding has not yet returned ... I think that the vast majority of examples, which are simple todo applications, make this much more trivial than when you are working on more complex projects.
My experiments went well, but I think that getting answers or feedback about the next series of problems with reckless moments can now save a lot of disappointments and move me to the direction of training, wherever I would like to be. I tried to include relevant snippets for examples that are detailed.
1) Routers are awesome, but aren't there places for heavy lifting?
The following router works to move the user from the page’s bootstrap to a specific route (search) that has its own SearchBoxView created in the last loaded js, like app.js in the TodoMVC example. However, when you try to configure the views in the router, as shown in the SummaryResultsView, a "not constructor" error is generated.
var Workspace = Backbone.Router.extend({
routes: {
'': 'default',
'search': 'searchBox',
'summary': 'summary',
'detail': 'detail',
},
default: function() {
console.log("Router: Default");
track.Router.navigate("#search", {
trigger: true,
replace: true
});
},
searchBox: function () {
console.log("Router: Search");
},
summary: function () {
console.log("Router: Summary");
new track.SummaryResultsView({ el: $("#summary #results")});
},
https://github.com/thomasdavis/backbonetutorials/blob/gh-pages/examples/modular-backbone/js/router.js, , , , . .
2) , ?
, , , , / . , , , . TodoMVC view.js .
3) . js
, require.js, , . , b/c CMS , AMD.
4) , colorbox datatables?
, , - smedium, , jQuery. , , , , , , . , backbone tablesorter ( ) () , w.r.t.
!