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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T07:55:49+00:00 2026-06-10T07:55:49+00:00

So I am using the Jquery plugin called FormatCurrency to (this should be obvious)

  • 0

So I am using the Jquery plugin called FormatCurrency to (this should be obvious) format some numbers in Currency format. The jQuery function is working great for the first row of numbers but the second row is having some issues.

Let me explain what I am doing first:

If I click on the tree and expand the row I want to select the tree opens up two more rows Capital and Expense. The jQuery works great on the capital row, the format is used and row is changed from 123456 to $123,456 but the Expense Row remains unchanged.

I also found that the Expense row does accept the formatCurrency style changes if I click on a different area, like if I expand another row with different numbers. So the Jquery is working, it just isn’t finishing the style change until I click on another row and if I go back to the original row that I had initially clicked on the style changes are removed again on only the Expense Row. I hope this all makes sense. I have posted my code below and I will be checking back often so feel free to ask any questions that could help with solving the issue. Thank you for your help!

pa_click = function (pa_label) {
            PA_ID = pa_label.getAttribute('pa_id');

            var pa_details = document.getElementById('pa-details-' + PA_ID);

            jQuery.getJSON('@Url.Action("getAjaxSCs")', { PA: pa_label.title }, function (SCS) {
                pa_details.innerHTML = "";
                jQuery.each(SCS, function (index, SC) {

                    months_html = '';
                    jQuery('.currency').formatCurrency({
                        colorize: true,
                        roundToDecimalPlace: -2,


                    });

                    for (var i = 0; i < 12; i++) {

                        index = index.replace(/\s/g, "-");
                        months_html +=
                                            '<div id="SC-' + index + '-' + months[i] + '" class="month-wrapper tree border-white currency">' + // This is where I add the currency class
                                            SC[i] + // This is the variable I need to replace with code to add currency to the amount  
                                            '</div>';
                    }

                    pa_details.innerHTML +=

                            '<div id ="Spend-Category-' + index + '" class="sc-wrapper tree border">' +
                                '<div id ="sc-title-' + index + '" class="sc-title">' +
                                    '<div class = "sc-label" title = "' + index + '" SC_id="' + index + '" onclick = "sc_click(this)">' + index + '</div>' +
                                    months_html +
                                '</div>' +
                                '<div id="sc-details-' + index + '" class = "pa-details" style = "display:none">' + index + '</div>' +
                            '</div>';
                })
            });
            jQuery('#pa-details-' + PA_ID).toggle('fast');

        };
  • 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-10T07:55:51+00:00Added an answer on June 10, 2026 at 7:55 am

    Place the call to .formatCurrency after you’ve added all of your elements to the DOM.

    For example, you could refactor like so:

    pa_details.innerHTML = "";
    
    jQuery.each(SCS, function (index, SC) {
      months_html = '';
      for (var i = 0; i < 12; i++) {
        ...
      }
      pa_details.innerHTML += "BIG CONCATENATION HERE";
    });
    
    jQuery('.currency').formatCurrency({
      colorize: true,
      roundToDecimalPlace: -2
    });
    

    This allows all elements to be present in the DOM before you try to format the element.

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

Sidebar

Related Questions

I'm using this plugin for jquery called resize-crop: http://code.google.com/p/resize-crop/ The problem with this is
I am using this new jQuery plugin called jsTree www.jstree.com and using the HTML
I am using a jQuery plugin called: jqtransform This plugin uses JavaScript to apply
I'm using a great jQuery content plugin called AnythingSlider . The problem is that
I'm using a great jQuery plugin called GMaps3 to display a map on a
I am using a JQuery Plugin called lightbox (which is great btw). Problem is,
I am using a jquery plugin called colorbox, this might be irrelevent though as
I'm using Jquery plugin called Limit as below $(document).ready( function () { $('[id$=Textarea1]').limit('150', '#charsLeft');
I'm using a jQuery plugin called Colorbox (http://colorpowered.com/colorbox/) and loading content via Ajax. This
I am using this jquery plugin for called tokeninput it's for autosuggestion when typing:

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.