Active
Project:
Backbone
Version:
7.x-1.x-dev
Component:
JS Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
23 Oct 2012 at 11:23 UTC
Updated:
23 Oct 2012 at 11:23 UTC
It would be helpful to store the renderer in the object, so one can define it when expanding the object and not have to do it on every instance.
eg. add a function like:
setRenderer: function(renderer) {
if (typeof renderer === "string") {
this.renderer = this.renderers[renderer];
} else if (typeof renderer === "object") {
this.renderer = renderer;
} else {
this.renderer = this.renderers.underscore;
}
},
and do
this.setRenderer(opts.renderer || this.renderer);
in the initialize-function.
Atle