@cdmx/wappler_ag_grid 1.4.8 → 1.4.9
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 +11 -12
- package/package.json +1 -1
package/dmx-ag-grid.js
CHANGED
|
@@ -1398,30 +1398,29 @@ dmx.Component('ag-grid', {
|
|
|
1398
1398
|
});
|
|
1399
1399
|
});
|
|
1400
1400
|
}
|
|
1401
|
-
|
|
1402
1401
|
if (columnsToCount) {
|
|
1403
1402
|
columnsToCount.forEach(function (colObj) {
|
|
1404
1403
|
const col = colObj.field;
|
|
1405
1404
|
const uniqueValuesToCount = new Set(colObj.unique_values.split(','));
|
|
1406
1405
|
result[0][col] = 0;
|
|
1407
|
-
const countedValues = new Set();
|
|
1408
1406
|
const uniqueValues = new Set();
|
|
1409
1407
|
|
|
1410
1408
|
rowData.forEach(function (line) {
|
|
1411
1409
|
const value = line.data[col];
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
if (
|
|
1410
|
+
if (line.index < rowData.length && value !== undefined && value !== null) {
|
|
1411
|
+
const valueString = value.toString();
|
|
1412
|
+
if (options.columns_to_count_nonunique || uniqueValuesToCount.has(valueString)) {
|
|
1415
1413
|
result[0][col]++;
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
if (!uniqueValues.has(value)) {
|
|
1420
|
-
uniqueValues.add(value);
|
|
1414
|
+
if (!uniqueValues.has(valueString)) {
|
|
1415
|
+
uniqueValues.add(valueString);
|
|
1416
|
+
}
|
|
1421
1417
|
}
|
|
1422
1418
|
}
|
|
1423
1419
|
});
|
|
1424
1420
|
|
|
1421
|
+
if (options.columns_to_count_nonunique) {
|
|
1422
|
+
result[0][col] = uniqueValues.size;
|
|
1423
|
+
}
|
|
1425
1424
|
result[0][col + '_unique_count'] = uniqueValues.size;
|
|
1426
1425
|
});
|
|
1427
1426
|
}
|
|
@@ -1454,14 +1453,14 @@ dmx.Component('ag-grid', {
|
|
|
1454
1453
|
if ((options.columns_to_sum && options.columns_to_sum.split(',').length > 0) || (options.columns_to_count.length > 0)) {
|
|
1455
1454
|
let columnsToSum = options.columns_to_sum ? options.columns_to_sum.split(',') : [];
|
|
1456
1455
|
let columnsToCount = options.columns_to_count;
|
|
1457
|
-
|
|
1456
|
+
|
|
1458
1457
|
gridConfig.onFilterChanged = function (e) {
|
|
1459
1458
|
totalRow(e.api, columnsToSum, columnsToCount);
|
|
1460
1459
|
};
|
|
1461
1460
|
gridConfig.onFirstDataRendered = function (e) {
|
|
1462
1461
|
totalRow(e.api, columnsToSum, columnsToCount);
|
|
1463
1462
|
};
|
|
1464
|
-
|
|
1463
|
+
gridConfig.postSortRows = function (e) {
|
|
1465
1464
|
totalRow(e.api, columnsToSum, columnsToCount);
|
|
1466
1465
|
};
|
|
1467
1466
|
}
|