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 7547703
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T09:31:13+00:00 2026-05-30T09:31:13+00:00

I have a template like script type: text/template, id: list-template, ”’ <div class=display> <div

  • 0

I have a template like

script type: "text/template", id: "list-template", '''    
    <div class="display">
        <div id="list-name"><%= name %></div>        
        <span class="list-destroy"></span>
    </div>
    <div>
        <ul id="ul-cards">

       </ul>
    </div>
    <div class="edit">
          <input class="list-input" type="text" value="<%= name %>" />
          <input id="btnEdit" type="button" value="Save" class="primary wide js-add-list" />
          <input id="hdnListId" type="hidden" value="<%= listId%>" />
    </div>
    <form class="add-list-card js-add-list-card clearfix"> 
        <textarea placeholder="Add card" class="new-card"></textarea> 
        <input type="button" value="Add" class="primary js-add-card"> 
        <a class="app-icon close-icon dark-hover cancel js-cancel-add-card" href="#" id="closeCard"></a> 
    </form>
'''

in this template i have <ul id="ul-cards"> element in which i want to render another template which display list inside this ul.
this template is :

script type: "text/template", id: "card-template", '''    
    <div>
        <span class="card-name"><%= name %></span>
    </div>
'''

is it possible or i have to do it in another way?
please help me if anyone have idea.
thanks in advace.


it is worked but still i have one problem in data display in
<ul id="ul-cards"> there sholud be 2

  • as per records in my database but it will display only 1
  • . data fetch properly but display only last data.

    • 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-05-30T09:31:14+00:00Added an answer on May 30, 2026 at 9:31 am

      There are two ways to do this: the DOM way and the template way.

      The DOM way involves adding your views using DOM methods: you have your ListView and your CardView; the ListView invokes individual CardViews that fill in the ListView’s element.

      The template way requires that you remember this: backbone’s views are policy frameworks, not policy templates. Render doesn’t have to render into the DOM. You can use render() to return a string, for example. If your event manager is on the ListView object only (possible; I’ve done this), then you can have ListView invoke “the resulting array of an array of CardView renders” and insert that directly into ListView’s template. This is actually faster, as you only require the browser to analyze the entire ListView HTML blob once, when it’s inserted into the innerHTML of the parent DOM object.

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

    Sidebar

    Related Questions

    I have a template like this: <script id=notesTemplate type=text/html> <li class=Note> <div class=NoteDate data-bind=style:
    I have a jquery template setup like this: <script id='tmpl-video_list' type='text/x-jquery-tmpl'> <li> <a href='${url}'><br/>
    Let's say I have a template like this <script id=rowTemplate type=text/x-jquery-tmpl> <tr> <a href=${
    Suppose I have knockout.js template like this: <script type=text/html id=mytemplate> <label for=inputId>Label for input</label>
    I have a mustache.js template defined like so: <script id=wishlist_template type=text/html> <h1>aaa{{ title }}</h1>
    I have a template like this: <div data-bind='template: { name: stringTemplate, foreach: stringCollection() }'>
    I have a template class like below. template<int S> class A { private: char
    Assume I have a function template like this: template<class T> inline void doStuff(T* arr)
    I have a template class defined like so: template <class T> class Command {
    I have a class like template <class T> struct A{ template <class U> A(U

    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.