Jump to content

Search the Community

Showing results for tags 'grouping'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Caspio Bridge
    • General Questions
    • Caspio JavaScript Solutions
    • Tables, Views and Relationships
    • Import/Export and DataHub
    • DataPages
    • Deployment
    • Security, Authentications, Roles, SAML
    • Styles and Localizations
    • Parameters
    • API and Integration
    • Calculations and aggregations
    • User JavaScript and CSS Discussions

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


MSN


Website URL


ICQ


Yahoo


Skype


Location


Interests

Found 2 results

  1. I have a tabular datapage which essentially has the columns of Group, Name, Calc 1, Calc 2, Calc 3 and an Aggregation of Agg1 . The grouping is done by Group field and Agg 1 is shown at that level. Is there a way I can hide the entire grouping if Agg 1 does not meet a certain criteria? Likewise I would like to highlight specific rows in the expanded group based on values in one of the calc fields (varies depending on situation). In the example below, I would want to hide all of Group 1 (Group 1 row w/Agg1 as well as Name 1.1 and Name 1.2 rows) if Agg 1 is less than a designated threshold value. Is there a way to do this? Group 1 Agg 1 Name 1.1 Calc 1 Calc2 Calc 3 Name 1.2 Calc 1 Calc2 Calc 3 Group 2 Agg 1 Name 2.1 Calc 1 Calc2 Calc 3 Name 2.2 Calc 1 Calc2 Calc 3
  2. This old post from Caspio should be updated with the following changes so that it works when Grouping is enabled: http://forums.caspio.com/index.php/topic/3171-js-calculate-column-sum-in-the-result-page/ Aggregation should be used instead, but if you want to SUM a Calculated Field which in turn is based on a sub-query, it will not be available for Aggregation. See the second paragraph here for details on this case http://howto.caspio.com/release-notes/caspio-bridge-9-0/9-0-known-issues/ I've highlighted the changes below </div> <script> function NumberFormatted(amount,decimal) { if(isNaN(amount)) i = 0.00; else { var v_number = parseFloat(amount); var v_minus = ''; if(v_number < 0) v_minus = '-'; v_number = Math.abs(v_number); v_number = Math.round(v_number*Math.pow(10,decimal)); v_number = v_number/Math.pow(10,decimal); v_numStr = new String(v_number); v_decStr = new String(Math.pow(10,decimal)); if(v_numStr.indexOf(".") < 0) v_numStr = v_numStr + "." + v_decStr.substr(1,v_decStr.length); else v_numStr = v_numStr + v_decStr.substr(1,v_decStr.length); return (v_minus + v_numStr.substr(0,v_numStr.indexOf(".") + decimal + 1)); } } function f_calTotal() { var v_totalRev = 0; var v_rev = 0; var cas_form = document.getElementById("cb_resultTotal"); if (cas_form.getElementsByTagName("table").length > 0) { //For counting all rows, so that we can use the count as the index for inserting a new row. var countRows = cas_form.getElementsByTagName("table")[2].getElementsByTagName("tr"); //For reading just the data rows, not the Grouping rows, to avoid null values. var cas_rows = cas_form.getElementsByTagName("table")[2].querySelectorAll('tr[data-cb-name=data]'); for(var rowIndex=1; rowIndex < cas_rows.length; rowIndex++) { //Narrows down to just data cells. var cells = cas_rows[rowIndex].querySelectorAll(".cbResultSetData"); /* 1 – change value inside brackets to choose column to calculate sum */ v_rev = cells[3].innerHTML; if ( v_rev != " " && !isNaN(v_rev.substr(1))) v_totalRev = v_totalRev + parseFloat(v_rev); } //New row will be based on count of all rows, not count of rows searched. var v_nrow = countRows.length; cas_form.getElementsByTagName("table")[2].insertRow(v_nrow); var o_lastRow = cas_form.getElementsByTagName("table")[2].rows[v_nrow]; o_lastRow.style.background = "#385C7E"; o_lastRow.insertCell(0); o_lastRow.insertCell(1); /* 2 – Display the “Total†label (2 lines below) */ var v_colText = o_lastRow.insertCell(2); v_colText.innerHTML = "<div style='padding:5px;color:#ffffff;font-size:14px;font-weight:bold;font-family:Arial'>Total</div>"; var v_colValue = o_lastRow.insertCell(3); /* 3 – Display the result of the calculation (2 lines below) */ v_colValue.innerHTML = "<div style='padding:5px;color:#ffffff;font-size:14px;font-weight:bold;;font-family:Arial'>$" + NumberFormatted(v_totalRev,2) + "</div>"; o_lastRow.insertCell(4); } } </script> <script> f_calTotal(); </script>
×
×
  • Create New...