Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8454637
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T12:04:41+00:00 2026-06-10T12:04:41+00:00

I am pretty new to backbone.js. I have the following setup Scripts |–App |

  • 0

I am pretty new to backbone.js. I have the following setup

Scripts
|--App
|   |--collecions
|   |    |----students.js
|   |--model
|   |    |---student.js
|   |--views
|   |    |---Header-View.js
|   |    |---Stud-List-View.js
|   |    |---Stud-Item-List-View.js
|   |    |---StudView.js
|   |--app.js
|--Templates
|   |-----Header.htm
|   |-----StudTable.htm
|   |-----student.htm
|--main.js

The StudTable.html is like this —–

<table class="table table-condensed table-bordered">
<caption>Student Details </caption>
<thead>
    <tr>
        <th>
            First Name
        </th>
        <th>
            Last Name
        </th>
        <th>
            Age
        </th>
    </tr>
</thead>
<tbody>
    <tr>
        <td>
            {{firstname}}
        </td>
        <td>
            {{lastname}}
        </td>
        <td>
            {{age}}
        </td>
    </tr>
</tbody>

How can I render the collection send from here

function ($, _, Backbone, Student, StudList, HeaderView, StudView, ListView, CloneView) {
 var AppView = Backbone.Router.extend({
     routes: {
         "": "list",
         "students/clone": "clone",            
     },

     initialize: function () {
         var view = new HeaderView();
         return this;
     },
     clone: function () {
         var studs = new StudList();
         studs.fetch({
             success: function () {
                 $("#content").html(new CloneView({ collection: studs }).el);
             }
         });
     },

 });    

 return AppView;
});

How can I show the collection there in table with help of jQuery cloning without touching the format of html template? Is there any way we can clone into the table for each element in the collection?

I don’t want to use something like two views like this question

Render Html Table with underscore template engine

They have used two views: one for tbody and another for appending tr to tbody. I want to do it in a single view, with the help of the template mentioned above. Is it possible to do that?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T12:04:43+00:00Added an answer on June 10, 2026 at 12:04 pm

    Based on comments, you should use 2 views and 2 templates. I don’t see any advantage at all to the “cloning” mechanism in the original post – that’s not the Backbone way!

    The main App view will render the main page HTML, and each individual <tr> view will represent a record in the database/datamodel. So render the main App view, and then loop through your JSON response to render each <tr> view individually.

    From there, you can add, delete, and sort rows with ease. Because each view will be tied directly to a model instance, the two can “talk” to one another very easily (yay Backone!).

    This site helped me learn the best way to organize my Backbone applications when i first started:
    http://ricostacruz.com/backbone-patterns/#sub_views

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Pretty new to C++, I have been following the intermediate tutorials at 3DBuzz.com, and
I'm pretty new to backbone.js and am still learning how everything works. I'm trying
I'm pretty new to Backbone and Marionette and am having a tough time getting
Pretty new to MVC and the like. I have a class the looks like
I've got a Backbone.js/Rails app and I'm trying to create a new object through
im new to backbone js and my first interaction seems pretty comple. the problem
I have a backbone collection and when I remove a model from the collection,
Pretty new to ASP.NET and trying to figure out how to have the code
I'm pretty new to Backbone so excuse me if this question is a little
Im pretty new to REST but as far as i have gathered i understand

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.