@cdmx/wappler_ag_grid 1.1.5 → 1.1.6
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 +23 -17
- package/package.json +1 -1
package/dmx-ag-grid.js
CHANGED
|
@@ -1161,6 +1161,13 @@ dmx.Component('ag-grid', {
|
|
|
1161
1161
|
suppressPropertyNamesCheck: this.props.suppress_property_names_check,
|
|
1162
1162
|
suppressRowDeselection: this.props.suppress_row_deselection,
|
|
1163
1163
|
columnHoverHighlight: this.props.column_hover_highlight,
|
|
1164
|
+
onGridSizeChanged: function(params) {
|
|
1165
|
+
// This function is called whenever the grid's size changes
|
|
1166
|
+
adjustHeaderWidth();
|
|
1167
|
+
if (options.fixed_horizontal_scroll) {
|
|
1168
|
+
updateHoveringBarStyles();
|
|
1169
|
+
}
|
|
1170
|
+
},
|
|
1164
1171
|
components: {
|
|
1165
1172
|
clickCellRenderer: clickCellRenderer,
|
|
1166
1173
|
checkboxCellRenderer: checkboxCellRenderer,
|
|
@@ -1326,6 +1333,18 @@ dmx.Component('ag-grid', {
|
|
|
1326
1333
|
console.error('Grid container not found.');
|
|
1327
1334
|
return;
|
|
1328
1335
|
}
|
|
1336
|
+
const agHeader = gridElement.querySelector('.ag-header');
|
|
1337
|
+
const agRootWrapper = gridElement.querySelector('.ag-root-wrapper');
|
|
1338
|
+
|
|
1339
|
+
// Function to adjust the header width
|
|
1340
|
+
function adjustHeaderWidth() {
|
|
1341
|
+
if (agHeader && agRootWrapper) {
|
|
1342
|
+
const rootWrapperWidth = agRootWrapper.clientWidth;
|
|
1343
|
+
const newHeaderWidth = rootWrapperWidth * 1.0;
|
|
1344
|
+
agHeader.style.width = `${newHeaderWidth}px`;
|
|
1345
|
+
}
|
|
1346
|
+
}
|
|
1347
|
+
adjustHeaderWidth();
|
|
1329
1348
|
if (options.fixed_header) {
|
|
1330
1349
|
window.addEventListener('scroll', function () {
|
|
1331
1350
|
const header = gridElement.querySelector('.ag-header');
|
|
@@ -1342,19 +1361,6 @@ dmx.Component('ag-grid', {
|
|
|
1342
1361
|
document.body.style.marginBottom = '0'; // Reset the margin
|
|
1343
1362
|
}
|
|
1344
1363
|
});
|
|
1345
|
-
const agHeader = gridElement.querySelector('.ag-header');
|
|
1346
|
-
const agRootWrapper = gridElement.querySelector('.ag-root-wrapper');
|
|
1347
|
-
|
|
1348
|
-
// Function to adjust the header width
|
|
1349
|
-
function adjustHeaderWidth() {
|
|
1350
|
-
if (agHeader && agRootWrapper) {
|
|
1351
|
-
const rootWrapperWidth = agRootWrapper.clientWidth;
|
|
1352
|
-
const newHeaderWidth = rootWrapperWidth * 1.0;
|
|
1353
|
-
agHeader.style.width = `${newHeaderWidth}px`;
|
|
1354
|
-
}
|
|
1355
|
-
}
|
|
1356
|
-
window.addEventListener('resize', adjustHeaderWidth);
|
|
1357
|
-
adjustHeaderWidth();
|
|
1358
1364
|
}
|
|
1359
1365
|
if (options.fixed_footer) {
|
|
1360
1366
|
window.addEventListener('scroll', function () {
|
|
@@ -1394,12 +1400,13 @@ dmx.Component('ag-grid', {
|
|
|
1394
1400
|
// Create a new style element
|
|
1395
1401
|
const styleElement = document.createElement('style');
|
|
1396
1402
|
styleElement.id = 'hovering-bar-style';
|
|
1397
|
-
const
|
|
1398
|
-
const
|
|
1403
|
+
const agRootWrapper = gridElement.querySelector('.ag-root-wrapper');
|
|
1404
|
+
const bodyHorizontalScrollElement = gridElement.querySelector('.ag-body-horizontal-scroll');
|
|
1405
|
+
const rootWrapperWidth = agRootWrapper.clientWidth;
|
|
1406
|
+
bodyHorizontalScrollElement.style.width = rootWrapperWidth + 'px';
|
|
1399
1407
|
// Add the styles for the hovering horizontal bottom bar
|
|
1400
1408
|
styleElement.innerHTML = `
|
|
1401
1409
|
.ag-body-horizontal-scroll {
|
|
1402
|
-
width: ${barWidth};
|
|
1403
1410
|
position: fixed;
|
|
1404
1411
|
bottom: 0;
|
|
1405
1412
|
}
|
|
@@ -1415,7 +1422,6 @@ dmx.Component('ag-grid', {
|
|
|
1415
1422
|
}
|
|
1416
1423
|
}
|
|
1417
1424
|
updateHoveringBarStyles();
|
|
1418
|
-
window.addEventListener('resize', updateHoveringBarStyles);
|
|
1419
1425
|
|
|
1420
1426
|
//CSV Export Function
|
|
1421
1427
|
exportGridData = () => {
|