@cdmx/wappler_ag_grid 1.4.9 → 1.5.1
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.
- package/dmx-ag-grid.js +6 -3
- package/package.json +1 -1
package/dmx-ag-grid.js
CHANGED
|
@@ -1404,24 +1404,27 @@ dmx.Component('ag-grid', {
|
|
|
1404
1404
|
const uniqueValuesToCount = new Set(colObj.unique_values.split(','));
|
|
1405
1405
|
result[0][col] = 0;
|
|
1406
1406
|
const uniqueValues = new Set();
|
|
1407
|
+
const totalValues = new Set();
|
|
1407
1408
|
|
|
1408
1409
|
rowData.forEach(function (line) {
|
|
1409
1410
|
const value = line.data[col];
|
|
1410
1411
|
if (line.index < rowData.length && value !== undefined && value !== null) {
|
|
1411
1412
|
const valueString = value.toString();
|
|
1412
|
-
if (
|
|
1413
|
+
if (uniqueValuesToCount.has(valueString)) {
|
|
1413
1414
|
result[0][col]++;
|
|
1415
|
+
totalValues.add(valueString);
|
|
1414
1416
|
if (!uniqueValues.has(valueString)) {
|
|
1415
1417
|
uniqueValues.add(valueString);
|
|
1416
1418
|
}
|
|
1417
1419
|
}
|
|
1418
1420
|
}
|
|
1419
1421
|
});
|
|
1420
|
-
|
|
1421
1422
|
if (options.columns_to_count_nonunique) {
|
|
1423
|
+
result[0][col + '_total_count'] = totalValues.size;
|
|
1424
|
+
}
|
|
1425
|
+
else {
|
|
1422
1426
|
result[0][col] = uniqueValues.size;
|
|
1423
1427
|
}
|
|
1424
|
-
result[0][col + '_unique_count'] = uniqueValues.size;
|
|
1425
1428
|
});
|
|
1426
1429
|
}
|
|
1427
1430
|
api.setGridOption('pinnedBottomRowData', result);
|