@cdmx/wappler_ag_grid 1.2.7 → 1.2.8
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/README.md +2 -0
- package/dmx-ag-grid.js +12 -12
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -136,6 +136,8 @@ This grid allows you to define custom data changes for specific fields. The grid
|
|
|
136
136
|
|
|
137
137
|
**Amount Fields** (Type: textbox, Default: null)
|
|
138
138
|
- Define the fields where the comma-separation and float parsing need to be applied.
|
|
139
|
+
**Amount Field Precision** (Type: number, Default: 2)
|
|
140
|
+
- Define the precision to be used for currency fields.
|
|
139
141
|
|
|
140
142
|
---
|
|
141
143
|
|
package/dmx-ag-grid.js
CHANGED
|
@@ -243,7 +243,7 @@ dmx.Component('ag-grid', {
|
|
|
243
243
|
transactionUpdate: function () {
|
|
244
244
|
// const oldRowData = this.get('oldData');
|
|
245
245
|
const gridInstance = this.get('gridInstance');
|
|
246
|
-
const oldRowData = gridInstance.
|
|
246
|
+
const oldRowData = gridInstance.getModel().rowsToDisplay.map(row => row.data);
|
|
247
247
|
const newRowData = this.props.data;
|
|
248
248
|
let transaction;
|
|
249
249
|
|
|
@@ -264,8 +264,8 @@ dmx.Component('ag-grid', {
|
|
|
264
264
|
}
|
|
265
265
|
|
|
266
266
|
if (gridInstance && gridInstance.gridOptions && transaction) {
|
|
267
|
-
gridInstance.
|
|
268
|
-
gridInstance.
|
|
267
|
+
gridInstance.applyTransaction(transaction);
|
|
268
|
+
gridInstance.refreshCells();
|
|
269
269
|
} else {
|
|
270
270
|
console.error('AG Grid instance or transaction not found.');
|
|
271
271
|
}
|
|
@@ -1322,10 +1322,10 @@ dmx.Component('ag-grid', {
|
|
|
1322
1322
|
columnsToCount.forEach(function (colObj) {
|
|
1323
1323
|
const col = colObj.field;
|
|
1324
1324
|
const uniqueValuesToCount = colObj.unique_values.split(',');
|
|
1325
|
-
|
|
1325
|
+
|
|
1326
1326
|
result[0][col] = 0;
|
|
1327
1327
|
let uniqueValues = new Set();
|
|
1328
|
-
|
|
1328
|
+
|
|
1329
1329
|
rowData.forEach(function (line) {
|
|
1330
1330
|
if (line.index < rowData.length) {
|
|
1331
1331
|
const value = line.data[col];
|
|
@@ -1335,11 +1335,11 @@ dmx.Component('ag-grid', {
|
|
|
1335
1335
|
}
|
|
1336
1336
|
}
|
|
1337
1337
|
});
|
|
1338
|
-
|
|
1338
|
+
|
|
1339
1339
|
result[0][col + '_unique_count'] = uniqueValues.size;
|
|
1340
1340
|
});
|
|
1341
1341
|
}
|
|
1342
|
-
api.
|
|
1342
|
+
api.setGridOption('pinnedBottomRowData', result);
|
|
1343
1343
|
}
|
|
1344
1344
|
|
|
1345
1345
|
const gridDiv = document.getElementById(options.id+'-grid');
|
|
@@ -1425,8 +1425,8 @@ dmx.Component('ag-grid', {
|
|
|
1425
1425
|
filter: customFilter.filter
|
|
1426
1426
|
};
|
|
1427
1427
|
});
|
|
1428
|
-
gridInstance.
|
|
1429
|
-
gridInstance.
|
|
1428
|
+
gridInstance.setFilterModel(filterModel);
|
|
1429
|
+
gridInstance.onFilterChanged();
|
|
1430
1430
|
}
|
|
1431
1431
|
|
|
1432
1432
|
const gridElement = document.getElementById(options.id+'-grid');
|
|
@@ -1437,7 +1437,7 @@ dmx.Component('ag-grid', {
|
|
|
1437
1437
|
const gridContainer = gridElement.parentNode;
|
|
1438
1438
|
// Add an event listener to the grid
|
|
1439
1439
|
if (options.row_checkbox_event) {
|
|
1440
|
-
|
|
1440
|
+
gridInstance.addEventListener('rowSelected', (event) => {
|
|
1441
1441
|
if (event.node && event.node.isSelected()) {
|
|
1442
1442
|
const rowData = event.node.data;
|
|
1443
1443
|
this.set('data', rowData);
|
|
@@ -1513,7 +1513,7 @@ dmx.Component('ag-grid', {
|
|
|
1513
1513
|
});
|
|
1514
1514
|
}
|
|
1515
1515
|
exportSelectedRows = () => {
|
|
1516
|
-
const selectedRows =
|
|
1516
|
+
const selectedRows = gridInstance.getSelectedRows();
|
|
1517
1517
|
this.set('selectedRows', selectedRows);
|
|
1518
1518
|
}
|
|
1519
1519
|
function updateHoveringBarStyles() {
|
|
@@ -1596,7 +1596,7 @@ dmx.Component('ag-grid', {
|
|
|
1596
1596
|
return params.value;
|
|
1597
1597
|
},
|
|
1598
1598
|
};
|
|
1599
|
-
|
|
1599
|
+
gridInstance.exportDataAsCsv(params);
|
|
1600
1600
|
};
|
|
1601
1601
|
// Create the export button
|
|
1602
1602
|
if (exportToCSV) {
|