grunt-doctrine
Version:
Grunt plugin to convert doctrine xml annotations into backbone models and collections. Useful in conjunction with doctrine apigility. Includes option to scaffold an entire BBB application
41 lines (27 loc) • 919 B
JavaScript
// Navigation
define(function(require, exports, module) {
"use strict";
var app = require("app");
var logger = require("lib/console");
var SelectBox = Backbone.View.extend({
/************ Backbone.LayoutManager *****************/
manage: true,
el: false,
beforeRender: function() {
this.$el.empty();
},
afterRender: function() {
this.$el.empty();
var me = this;
this.collection.each(function(model) {
console.debug('iterate model', model.attributes);
me.$el.append($('<option/>').attr('value', model.getId()).text(model.getLabel()));
}, this);
},
initialize: function() {
this.listenTo(this.collection, 'sync', this.render, this);
this.collection.fetch();
}
});
module.exports = SelectBox;
});