@cdmx/wappler_ag_grid 0.9.5 → 0.9.7

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,9 @@
1163
1163
  "display": "fieldset",
1164
1164
  "show": [
1165
1165
  "columnsToCount",
1166
- "columnsToSum"
1166
+ "columnsToSum",
1167
+ "enableFixedFooter",
1168
+ "fixedFooterBottomPadding",
1167
1169
  ],
1168
1170
  "noChangeOnHide": true,
1169
1171
  "groupEnabler": true,
@@ -1171,6 +1173,7 @@
1171
1173
  "children": [
1172
1174
  {
1173
1175
  "name": "columnsToCount",
1176
+ "attributeStartsWith": "dmx-bind",
1174
1177
  "attribute": "columns_to_count",
1175
1178
  "title": "Columns to Count",
1176
1179
  "type": "grid",
@@ -1205,6 +1208,24 @@
1205
1208
  "title": "Columns To Sum",
1206
1209
  "type": "text",
1207
1210
  "initDisplay": "none"
1211
+ },
1212
+ {
1213
+ "name": "enableFixedFooter",
1214
+ "attribute": "dmx-bind:fixed_footer",
1215
+ "title": "Fixed Footer",
1216
+ "type": "boolean",
1217
+ "initDisplay": "none",
1218
+ "defaultValue": false,
1219
+ "help": "Enables Fixed Total Row Footer"
1220
+ },
1221
+ {
1222
+ "name": "fixedFooterBottomPadding",
1223
+ "attribute": "dmx-bind:fixed_footer_bottom_padding",
1224
+ "title": "Fixed Footer Bottom Padding",
1225
+ "type": "number",
1226
+ "initDisplay": "none",
1227
+ "defaultValue": 10,
1228
+ "help": "Fixed Footer Bottom Padding"
1208
1229
  }
1209
1230
  ]
1210
1231
  }
package/dmx-ag-grid.js CHANGED
@@ -61,6 +61,8 @@ 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 },
65
+ fixed_footer_bottom_padding: { type: Number, default: 10 },
64
66
  timezone: {type: String, default: '' },
65
67
  cell_click_event: {type: Boolean, default: false },
66
68
  row_click_event: {type: Boolean, default: false },
@@ -1216,7 +1218,7 @@ dmx.Component('ag-grid', {
1216
1218
  if ((options.columns_to_sum && options.columns_to_sum.split(',').length > 0) || (options.columns_to_count.length > 0)) {
1217
1219
  let columnsToSum = options.columns_to_sum ? options.columns_to_sum.split(',') : [];
1218
1220
  let columnsToCount = options.columns_to_count;
1219
-
1221
+
1220
1222
  gridConfig.onFilterChanged = function (e) {
1221
1223
  totalRow(e.api, columnsToSum, columnsToCount);
1222
1224
  };
@@ -1272,6 +1274,34 @@ dmx.Component('ag-grid', {
1272
1274
  }
1273
1275
  });
1274
1276
  }
1277
+ if (options.fixed_footer) {
1278
+ window.addEventListener('scroll', function () {
1279
+ if (gridDiv.scrollTop >= (gridDiv.scrollHeight - gridDiv.clientHeight)) {
1280
+ const footerRow = document.querySelector('.ag-row-pinned');
1281
+ const footerRowDiv = document.querySelector('.ag-floating-bottom.ag-selectable');
1282
+ if (footerRow) {
1283
+ footerRow.classList.remove('ag-row-pinned');
1284
+ footerRow.classList.add('ag-row-even');
1285
+ footerRow.style.position = 'fixed';
1286
+ footerRow.style.bottom = options.fixed_footer_bottom_padding+'px';
1287
+ footerRow.style.borderTop = '1px solid #ccc';
1288
+ footerRow.style.borderBottom = '1px solid #ccc';
1289
+ footerRowDiv.style.height = '0px';
1290
+ footerRowDiv.style.minHeight = '0px';
1291
+ }
1292
+ const bottomViewport = document.querySelector('.ag-floating-bottom-viewport');
1293
+ if (bottomViewport) {
1294
+ bottomViewport.style.position = 'fixed';
1295
+ bottomViewport.style.bottom = '0';
1296
+ }
1297
+ } else {
1298
+ const footerRow = document.querySelector('.fixed-footer-row');
1299
+ if (footerRow) {
1300
+ footerRow.classList.add('ag-row-pinned');
1301
+ }
1302
+ }
1303
+ });
1304
+ }
1275
1305
  exportSelectedRows = () => {
1276
1306
  const selectedRows = gridConfig.api.getSelectedRows();
1277
1307
  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.7",
4
4
  "type": "module",
5
5
  "description": "App Connect module for AG Grid Table Generation.",
6
6
  "license": "MIT",