Try this:
EDIT: It's a Backbone Boilerplate app so I update the answer:
The problem is that how to get a view's $el of "Partials" module after it being rendered.
I try to define a module and declare a Backbone view as its member. Then I create a instance of view then chain the method call via view.render().$el. It get the view's $el successfully because in Backbone Boilerplate render() has its default behavior. Native backbone render function is designed to be overridden.
My simple example:
Module declaration (modules/user):
define(["app"],
function(app){
var User = app.module();
User.Views.Item = Backbone.View.extend({
template: "user/item",
tagName: "li",
serialize: function(){
return {model: this.model};
},
initialize: function(){
this.listenTo(this.model, "change", this.render);
}
});
return User;
});
Item template (templates/user/item.html)
<a href="#"><%=model.get("name")%></a>
Try to get view's $el in Router initialize call
define([
// Application.
"app","modules/user"
],
function(app, User) {
// Defining the application router, you can attach sub routers here.
var Router = Backbone.Router.extend({
initialize: function(){
app.useLayout("main-layout").setViews({
".users":new User.Views.Item({model:new Backbone.Model({"name":"cccc"})})
}).render();
//try to access $el. it works
console.log(new User.Views.Item({model:new Backbone.Model({"name":"cccc"})}).render().$el);
},
routes: {
"": "index",
"user/:name":"user"
},
index: function() {
},
user: function(){
}
});
return Router;
});
Finally I got the $el:

Hope this is helpful to you.