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

  • Home
  • SEARCH
  • 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 7653503
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T12:03:03+00:00 2026-05-31T12:03:03+00:00

I am trying to implement a feature and I have no idea how to

  • 0

I am trying to implement a feature and I have no idea how to go about it. My project leverages Django to implement backend logic and templating and Google Closure javascript library for front end.

My use case is given below:

I use a “rate”value to calculate the Total Amount for numerous entities. The entities are displayed in tabular format as follows:

<!-- I need to reload this table again.  -->
<table class = "striped" ....>
 <thead>
   <tr>
      <th>Entity</th>
      <th>Amount (USD)</th>
      <th>Rate (%)</th>
    </tr>
  </thead>
  <tbody>
     {% for entity in entities %}
     <tr>
        <td>{{ entity.name }}</td>
        <td>${{ entity.total }}</td>
        <td>{{ entity.rate }}</td>
     </tr>
    {% endfor %}
  </tbody>
 </table>

The rate is available in the database table to calculate the total amount. But I have to do the following “what-if” scenario; What would the total be if the “rate” was changed?

I have an input box that accepts new rate as follows:

<label for="Updated Rate">
<input type=number id="updatedRate" name="updatedRate" value="0" />
<input type="button" value="Update Rate" />
<input type="button" value="Recalculate Entities"/>
<input type="reset" value="Reset rate and Recalculate"/>

I store the update rates value to windows local storage when the user clicks the Update Rate button, then. If the user clicks the Recalculate Entities button, then I would like to make a AJAX request to the back end to recalculate the updated value and re render the table with the updated values. If the user resets the rate value, then the recalculated values must be In this event, the rate used would be fetched from the database and the table would have to re rendered.

I know how to make a AJAX request to the back end to recalculate the data.but I don’t know how to re render the table if the “rate” has been updated or reset.

  • 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-31T12:03:04+00:00Added an answer on May 31, 2026 at 12:03 pm

    You need a way to identify the entity you are calculating for. Something like:

    {% for entity in entities %}
     <tr data-id="{{ entity.id }}">
        <td>{{ entity.name }}</td>
        <td class="total">${{ entity.total }}</td>
        <td>{{ entity.rate }}</td>
     </tr>
    {% endfor %}
    

    Then in the callback of the ajax replace the total:

    $.ajax({
      url: 'someurl',
      success: function(json) {
        $('tr[data-id=' + json.id + '] td.total').text(json.total);
      }
    });
    

    Of course the actually structure of the returned data will vary. But I think you’ve got the basic structure.

    That help?

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

Sidebar

Related Questions

I'm trying to implement the feature Pushnotification in my app. I have followed the
I am trying to implement a feature similar to the Related Questions on StackOverflow,
I am trying to implement a feature similar to the "Related Questions" on Stackoverflow.
I am trying to implement the AudioFileStreamSeek feature on my streaming app. But there
I am trying to implement a similar feature like the autosuggest feature for tags
I'm trying to implement an undo/redo feature into my application, using the Command Pattern
I am trying to implement a bulk update feature in a Rails app, the
I am really confused about how I should approach/implement a filter feature. So I
I am trying to implement a feature. But I've never had anything to do
I'm trying to implement the following feature: I want just one css file to

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.