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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T00:36:21+00:00 2026-06-04T00:36:21+00:00

I have a table that has a button on each TR that fires a

  • 0

I have a table that has a button on each TR that fires a jquery dialog, and i need to populate the dialog with the TD values of that TR #id

So i accomplished this by the following:

trid = $( this ).parents( 'tr' ).attr( "id" );
$('#'+trid+' td').each(function() {
        $("#bdcontent").append("<li>"+$(this).html()+"</li>");
    });

I use jsrender on multiple other parts of the same site, and didnt know how you could or should use jsRender in this respect

I suppose doing the following would get the job done, provided i knew the syntax to pass to teh template:

 <script id="billDialogTemplate" type="text/x-jquery-tmpl">
    <li>{{=???}}</li>
 </script>
 ...

$('#'+trid+' td').each(function() {
        $("#bdcontent").append( $("#billDialogTemplate").render( $(this) ));
    });

but wanted to see if there was a cleaner/better way, if i should not consider jsrender templating for this type of action, or even if jsrender could accept data that was not in JSON format, or how i could build a json array from the TD values then pass to jsrender

  • 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-04T00:36:22+00:00Added an answer on June 4, 2026 at 12:36 am

    when you want only to pass the contents, you can access the contents with the #data special keyword

    but why are you using jsRender for this simple task? if you only want to pass the content of your <td> why not

    $("#bdcontent").append("<li>" + $(this) + "</td>");
    

    if this is just an example and you have a complex template, you need to use #data to access the raw information that was passed into your template

    <script id="billDialogTemplate" type="text/x-jquery-tmpl">
        <li>{{:#data}}</li>
    </script>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a table of buttons that are printed using PHP. Each button has
I have a table where each row has a button that triggers AJAX call.
I have a table that has three different date columns, so I set each
I have a table that has records with a structure similar to this.. ID
I have periods table that has start_at:datetime end_at:datetime . Because each period begins and
i have a table that has following column Type -------- type 1 type 2
I have multiple table rows that has a set of radio buttons on each
I have a table view that has many cells. Each cell has its own
I have a table that shows a list of events, each event also has
I have a table containing images and buttons. Each button has a tag with

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.