@cdmx/wappler_ag_grid 0.9.5 → 0.9.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/README.md CHANGED
@@ -200,6 +200,7 @@ The "Total Row Footer" feature allows you to define and display a footer row in
200
200
  Configuration includes:
201
201
  - **Columns To Count**: Specify the columns you want to count in the footer row. Separate column names with commas.
202
202
  - **Columns To Sum**: Specify the columns you want to calculate the sum of in the footer row. Separate column names with commas.
203
+ - **Fixed Footer**: Enables fixed footer totals row. (Default: false)
203
204
 
204
205
  ---
205
206
 
@@ -1163,7 +1163,8 @@
1163
1163
  "display": "fieldset",
1164
1164
  "show": [
1165
1165
  "columnsToCount",
1166
- "columnsToSum"
1166
+ "columnsToSum",
1167
+ "enableFixedFooter"
1167
1168
  ],
1168
1169
  "noChangeOnHide": true,
1169
1170
  "groupEnabler": true,
@@ -1205,7 +1206,16 @@
1205
1206
  "title": "Columns To Sum",
1206
1207
  "type": "text",
1207
1208
  "initDisplay": "none"
1208
- }
1209
+ },
1210
+ {
1211
+ "name": "enableFixedFooter",
1212
+ "attribute": "dmx-bind:fixed_footer",
1213
+ "title": "Fixed Footer",
1214
+ "type": "boolean",
1215
+ "initDisplay": "none",
1216
+ "defaultValue": false,
1217
+ "help": "Enables Fixed Total Row Footer"
1218
+ },
1209
1219
  ]
1210
1220
  }
1211
1221
  ]
package/dmx-ag-grid.js CHANGED
@@ -61,6 +61,7 @@ dmx.Component('ag-grid', {
61
61
  fixed_top_offset: { type: Number, default: 80 },
62
62
  fixed_horizontal_scroll: { type: Boolean, default: false },
63
63
  fixed_horizontal_scroll_width: { type: Number, default: 80 },
64
+ fixed_footer: { type: Boolean, default: false },
64
65
  timezone: {type: String, default: '' },
65
66
  cell_click_event: {type: Boolean, default: false },
66
67
  row_click_event: {type: Boolean, default: false },
@@ -1216,7 +1217,7 @@ dmx.Component('ag-grid', {
1216
1217
  if ((options.columns_to_sum && options.columns_to_sum.split(',').length > 0) || (options.columns_to_count.length > 0)) {
1217
1218
  let columnsToSum = options.columns_to_sum ? options.columns_to_sum.split(',') : [];
1218
1219
  let columnsToCount = options.columns_to_count;
1219
-
1220
+
1220
1221
  gridConfig.onFilterChanged = function (e) {
1221
1222
  totalRow(e.api, columnsToSum, columnsToCount);
1222
1223
  };
@@ -1272,6 +1273,30 @@ dmx.Component('ag-grid', {
1272
1273
  }
1273
1274
  });
1274
1275
  }
1276
+ if (options.fixed_footer) {
1277
+ window.addEventListener('scroll', function () {
1278
+ if (gridDiv.scrollTop >= (gridDiv.scrollHeight - gridDiv.clientHeight)) {
1279
+ const footerRow = document.querySelector('.ag-row-pinned');
1280
+ if (footerRow) {
1281
+ footerRow.classList.remove('ag-row-pinned');
1282
+ footerRow.classList.add('ag-row-even');
1283
+ footerRow.style.position = 'fixed';
1284
+ footerRow.style.bottom = '10px';
1285
+ footerRow.style.paddingBottom = '27px'
1286
+ }
1287
+ const bottomViewport = document.querySelector('.ag-floating-bottom-viewport');
1288
+ if (bottomViewport) {
1289
+ bottomViewport.style.position = 'fixed';
1290
+ bottomViewport.style.bottom = '0';
1291
+ }
1292
+ } else {
1293
+ const footerRow = document.querySelector('.fixed-footer-row');
1294
+ if (footerRow) {
1295
+ footerRow.classList.add('ag-row-pinned');
1296
+ }
1297
+ }
1298
+ });
1299
+ }
1275
1300
  exportSelectedRows = () => {
1276
1301
  const selectedRows = gridConfig.api.getSelectedRows();
1277
1302
  this.set('selectedRows', selectedRows);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cdmx/wappler_ag_grid",
3
- "version": "0.9.5",
3
+ "version": "0.9.6",
4
4
  "type": "module",
5
5
  "description": "App Connect module for AG Grid Table Generation.",
6
6
  "license": "MIT",