@cdmx/wappler_ag_grid 1.5.0 → 1.5.2
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 +12 -5
- package/package.json +1 -1
package/dmx-ag-grid.js
CHANGED
|
@@ -368,6 +368,8 @@ dmx.Component('ag-grid', {
|
|
|
368
368
|
const cnames = this.props.cnames
|
|
369
369
|
const cwidths = this.props.cwidths
|
|
370
370
|
const ctypes = this.props.ctypes
|
|
371
|
+
let gridInstance = this.get('gridInstance') ? this.get('gridInstance') : null;
|
|
372
|
+
let pagination_page_size = gridInstance ? gridInstance.paginationGetPageSize() : this.props.pagination_page_size
|
|
371
373
|
const enableRowClickEvent = this.props.row_click_event && !this.props.enable_actions && !this.props.row_checkbox_event;
|
|
372
374
|
const enableRowDoubleClickEvent = this.props.row_double_click_event && !this.props.enable_actions && !this.props.row_checkbox_event;
|
|
373
375
|
const enableCellClickEvent = this.props.row_click_event && (this.props.enable_actions || this.props.row_checkbox_event);
|
|
@@ -376,7 +378,6 @@ dmx.Component('ag-grid', {
|
|
|
376
378
|
let columnDefs = [];
|
|
377
379
|
let groupedColumnDefs = [];
|
|
378
380
|
let exportToCSV = this.props.export_to_csv;
|
|
379
|
-
let gridInstance = null;
|
|
380
381
|
let cellRenderer;
|
|
381
382
|
const gridThemeClass = options.dark_mode ? `${options.grid_theme}-dark` : options.grid_theme;
|
|
382
383
|
this.$node.innerHTML = `<div id=${options.id}-grid class="${gridThemeClass}"></div>`;
|
|
@@ -1300,7 +1301,7 @@ dmx.Component('ag-grid', {
|
|
|
1300
1301
|
suppressRowDeselection: this.props.suppress_row_deselection,
|
|
1301
1302
|
pagination: this.props.pagination,
|
|
1302
1303
|
paginationAutoPageSize: this.props.pagination_auto_page_size,
|
|
1303
|
-
paginationPageSize:
|
|
1304
|
+
paginationPageSize: pagination_page_size,
|
|
1304
1305
|
paginationPageSizeSelector: options.pagination_page_size_selector,
|
|
1305
1306
|
rowHeight: this.props.row_height,
|
|
1306
1307
|
headerHeight: this.props.header_height,
|
|
@@ -1404,21 +1405,27 @@ dmx.Component('ag-grid', {
|
|
|
1404
1405
|
const uniqueValuesToCount = new Set(colObj.unique_values.split(','));
|
|
1405
1406
|
result[0][col] = 0;
|
|
1406
1407
|
const uniqueValues = new Set();
|
|
1408
|
+
const totalValues = new Set();
|
|
1407
1409
|
|
|
1408
1410
|
rowData.forEach(function (line) {
|
|
1409
1411
|
const value = line.data[col];
|
|
1410
1412
|
if (line.index < rowData.length && value !== undefined && value !== null) {
|
|
1411
1413
|
const valueString = value.toString();
|
|
1412
|
-
if (
|
|
1414
|
+
if (uniqueValuesToCount.has(valueString)) {
|
|
1413
1415
|
result[0][col]++;
|
|
1416
|
+
totalValues.add(valueString);
|
|
1414
1417
|
if (!uniqueValues.has(valueString)) {
|
|
1415
1418
|
uniqueValues.add(valueString);
|
|
1416
1419
|
}
|
|
1417
1420
|
}
|
|
1418
1421
|
}
|
|
1419
1422
|
});
|
|
1420
|
-
|
|
1421
|
-
result[0][col + '
|
|
1423
|
+
if (options.columns_to_count_nonunique) {
|
|
1424
|
+
result[0][col + '_total_count'] = totalValues.size;
|
|
1425
|
+
}
|
|
1426
|
+
else {
|
|
1427
|
+
result[0][col] = uniqueValues.size;
|
|
1428
|
+
}
|
|
1422
1429
|
});
|
|
1423
1430
|
}
|
|
1424
1431
|
api.setGridOption('pinnedBottomRowData', result);
|