Need Bubbler with Javascript skill

I have a nested RG, I calculate the totalSum of each row using javascript and display it in the main RG.
I need help to add sorting from small to large totalSum in main RG
From what I understand, it’s a few lines of code, so the budget is tight, under $50
Here’s my existing javascript code:
$(document).ready(function() {
// Iterate through each group in RG1
$(‘.rg1-group’).each(function() {
var totalSum = 0;

    // Iterate through each row in RG2 within the current group
    $(this).find('.rg2-row').each(function() {
        // Get the value from the current row in RG2 and convert it to a number
        var value = parseFloat($(this).find('.value-element').text());

        // Check if the value is a valid number and add it to the total sum
        if (!isNaN(value)) {
            totalSum += value;
        }
    });

    // Find the HTML element within the current group in RG1 where you want to display the sum
    var targetElement = $(this).find('.html-element-for-sum');

    // Format the totalSum with two decimal places and update the HTML element
    targetElement.html('£' + totalSum.toFixed(2));
});

});

Hey man,

Couple of things.

1- you can actually just put data into an input, not text element and then you can calculate from there very easily without code.

2- I think @Thimo has a plug in that ranks based from values that’s very powerful! Worked a treat for me

1 Like

Hey mate,

Check out the ListSorter plugin, I built it to solve this exact use case checkout the YouTube video to make sure it suits your needs :slight_smile:

1 Like