@cdmx/wappler_ag_grid 1.9.16 → 1.9.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dmx-ag-grid.js +18 -10
  2. package/package.json +1 -1
package/dmx-ag-grid.js CHANGED
@@ -1288,16 +1288,20 @@ dmx.Component('ag-grid', {
1288
1288
  const matchingJsChange = options.js_data_changes.find(change => change.field === key);
1289
1289
  if (matchingJsChange) {
1290
1290
  cellRenderer = function (params) {
1291
- if (typeof window[matchingJsChange.function] === 'function') {
1291
+ // Don't apply custom renderer to pinned bottom rows (totals)
1292
+ if (params.node && params.node.rowPinned === 'bottom') {
1293
+ return "-";
1294
+ }
1295
+ if (typeof window[matchingJsChange.function] === 'function') {
1292
1296
  const cellValue = window[matchingJsChange.function](params.data);
1293
1297
  return cellValue;
1294
1298
  }
1299
+ }
1300
+ }
1301
+ else {
1302
+ cellRenderer = undefined;
1303
+ colId = undefined;
1295
1304
  }
1296
- }
1297
- else {
1298
- cellRenderer = undefined;
1299
- colId = undefined;
1300
- }
1301
1305
  }
1302
1306
  else {
1303
1307
  cellRenderer = undefined;
@@ -1741,13 +1745,17 @@ dmx.Component('ag-grid', {
1741
1745
  columnsToSum.forEach(function (col) {
1742
1746
  result[0][col] = 0;
1743
1747
  rowData.forEach(function (line) {
1744
- if (line.index < rowData.length) {
1745
- result[0][col] += parseFloat(line.data[col]) || line.data[col];
1748
+ if (line.index < rowData.length && line.data[col] !== null && line.data[col] !== undefined) {
1749
+ // Convert to number and handle NaN
1750
+ const value = Number(line.data[col]);
1751
+ if (!isNaN(value)) {
1752
+ result[0][col] += value;
1753
+ }
1746
1754
  }
1747
1755
  });
1748
1756
  // Apply footer sum precision if specified
1749
- if (options.footer_sum_precision) {
1750
- result[0][col] = parseFloat(result[0][col].toFixed(options.footer_sum_precision) );
1757
+ if (options.footer_sum_precision !== null && !isNaN(result[0][col])) {
1758
+ result[0][col] = Number(result[0][col].toFixed(options.footer_sum_precision));
1751
1759
  }
1752
1760
  });
1753
1761
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cdmx/wappler_ag_grid",
3
- "version": "1.9.16",
3
+ "version": "1.9.18",
4
4
  "type": "module",
5
5
  "description": "App Connect module for AG Grid Table Generation.",
6
6
  "license": "MIT",