0
我有一個骨幹收集。我拿。服務器返回一個JSON。我如何使用新數據填充集合?這是我的代碼:骨幹收集人口與服務器數據
var Todos = Backbone.Collection.extend({
url: "server/todos-service.php", // this does what it is supposed to do so no worries!
model: Todo,
initialize: function(attributes, options) {
// IN HERE WHAT DO I HAVE TO DO?
// WHAT EVENT SHALL I BIND TO TO REACT THE DATA DELIVERY?
// AND WHAT SHALL I DO NEXT TO POPULATE THE DAMN THINGS
}
});
// CLIENT CODE
new Todos().fetch();
有誰能告訴我這是應該怎麼辦?
乾杯
我同意,我從來沒有做到這一點的基礎知識,但多數民衆贊成什麼大多數爲待辦事項例子簡單的緣故。我想我會更新它haha – hajpoj
我看到... ...「重置」是no1完美的不良事件名稱... – nourdine