@cdmx/wappler_ag_grid 1.0.2 → 1.0.3

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.
Files changed (2) hide show
  1. package/dmx-ag-grid.js +14 -2
  2. package/package.json +1 -1
package/dmx-ag-grid.js CHANGED
@@ -1287,12 +1287,25 @@ dmx.Component('ag-grid', {
1287
1287
  header.style.position = 'fixed';
1288
1288
  header.style.top = `${topbarHeight}px`;
1289
1289
  header.style.zIndex = '1';
1290
- document.body.style.marginBottom = `${header.offsetHeight}px`; // Add margin to the bottom of the page
1290
+ document.body.style.marginBottom = `${header.offsetHeight}px`;
1291
1291
  } else {
1292
1292
  header.style.position = 'static';
1293
1293
  document.body.style.marginBottom = '0'; // Reset the margin
1294
1294
  }
1295
1295
  });
1296
+ const agHeader = document.querySelector('.ag-header');
1297
+ const agRootWrapper = document.querySelector('.ag-root-wrapper');
1298
+
1299
+ // Function to adjust the header width
1300
+ function adjustHeaderWidth() {
1301
+ if (agHeader && agRootWrapper) {
1302
+ const rootWrapperWidth = agRootWrapper.clientWidth;
1303
+ const newHeaderWidth = rootWrapperWidth * 1.0;
1304
+ agHeader.style.width = `${newHeaderWidth}px`;
1305
+ }
1306
+ }
1307
+ window.addEventListener('resize', adjustHeaderWidth);
1308
+ adjustHeaderWidth();
1296
1309
  }
1297
1310
  if (options.fixed_footer) {
1298
1311
  window.addEventListener('scroll', function () {
@@ -1408,7 +1421,6 @@ dmx.Component('ag-grid', {
1408
1421
  };
1409
1422
  gridConfig.api.exportDataAsCsv(params);
1410
1423
  };
1411
-
1412
1424
  // Create the export button
1413
1425
  if (exportToCSV) {
1414
1426
  const existingExportButton = document.getElementById('exportButton');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cdmx/wappler_ag_grid",
3
- "version": "1.0.2",
3
+ "version": "1.0.3",
4
4
  "type": "module",
5
5
  "description": "App Connect module for AG Grid Table Generation.",
6
6
  "license": "MIT",