devices view/models created

This commit is contained in:
Hendrik Fellerhoff 2012-03-23 03:13:44 +01:00
parent 4e26793524
commit 60d5fc8323
3 changed files with 15 additions and 0 deletions

View File

@ -24,6 +24,8 @@ $(document).ready(function() {
window.rooms = new Rooms();
window.roomsView = new RoomsView({collection: rooms});
window.devices = new Devices();
window.devicesView = new DevicesView({collection: devices});
window.App = new Workspace();
Backbone.history.start()

View File

@ -4,4 +4,9 @@
model: Room,
url: '/resources/json/rooms.json'
});
window.Device = Backbone.Model.extend({});
window.Devices = Backbone.Collection.extend({
model: Device,
url: '/control/devices'
});
})(jQuery);

View File

@ -12,3 +12,11 @@ window.RoomsView = Backbone.View.extend({
return this;
}
});
window.DevicesView = Backbone.View.extend({
initialize: function() {
this.collection.bind('reset', this.render, this);
},
render: function() {
}
});