@cdmx/wappler_ag_grid 1.5.7 → 1.5.9

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.
@@ -316,6 +316,14 @@
316
316
  "defaultValue": "dd/MM/yyyy hh:mm A",
317
317
  "help": "Date Format"
318
318
  },
319
+ {
320
+ "name": "quickFilterField",
321
+ "attribute": "quick_filter_field",
322
+ "title": "Filter Field ID",
323
+ "type": "text",
324
+ "defaultValue": "search_field",
325
+ "help": "Specifies the field ID of the search field when using grid quick filter"
326
+ },
319
327
  {
320
328
  "name": "loadingOverlay",
321
329
  "attribute": "dmx-bind:loading_overlay",
@@ -2324,6 +2332,15 @@
2324
2332
  state: 'opened',
2325
2333
  help: 'Get Selected Rows',
2326
2334
  properties: []
2335
+ },
2336
+ {
2337
+ addTitle: 'quickFilter',
2338
+ title: 'Quick Filter',
2339
+ name: 'quickFilter',
2340
+ icon: 'fas fa-lg fa-search',
2341
+ state: 'opened',
2342
+ help: 'Quick Search',
2343
+ properties: []
2327
2344
  }
2328
2345
  ],
2329
2346
  "children": [],
package/dmx-ag-grid.js CHANGED
@@ -71,6 +71,7 @@ dmx.Component('ag-grid', {
71
71
  filter: { type: Boolean, default: true },
72
72
  floating_filter: { type: Boolean, default: true },
73
73
  column_hover_highlight: { type: Boolean, default: true },
74
+ quick_filter_field: { type: String, default: 'search_field' },
74
75
  export_to_csv: { type: Boolean, default: true },
75
76
  export_csv_filename: { type: String, default: 'export.csv' },
76
77
  fixed_header: { type: Boolean, default: false },
@@ -241,6 +242,9 @@ dmx.Component('ag-grid', {
241
242
  },
242
243
  getSelectedRows: function () {
243
244
  exportSelectedRows();
245
+ },
246
+ quickFilter: function () {
247
+ onFilterTextBoxChanged();
244
248
  }
245
249
  },
246
250
 
@@ -615,12 +619,12 @@ dmx.Component('ag-grid', {
615
619
  let finalResult = results[0];
616
620
 
617
621
  for (let i = 0; i < operators.length; i++) {
618
- if (operators[i] === '||') {
619
- finalResult = finalResult || results[i + 1];
620
- } else if (operators[i] === '&&') {
621
- finalResult = finalResult && results[i + 1];
622
- }
623
- }
622
+ if (operators[i] === '||') {
623
+ finalResult = finalResult || results[i];
624
+ } else if (operators[i] === '&&') {
625
+ finalResult = finalResult && results[i];
626
+ }
627
+ }
624
628
  return finalResult;
625
629
  }
626
630
 
@@ -1475,7 +1479,7 @@ dmx.Component('ag-grid', {
1475
1479
  gridConfig.onFirstDataRendered = function (e) {
1476
1480
  totalRow(e.api, columnsToSum, columnsToCount);
1477
1481
  };
1478
- gridConfig.postSortRows = function (e) {
1482
+ gridConfig.postSortRows = function (e) {
1479
1483
  totalRow(e.api, columnsToSum, columnsToCount);
1480
1484
  };
1481
1485
  }
@@ -1488,7 +1492,7 @@ gridConfig.postSortRows = function (e) {
1488
1492
  gridInstance.hideOverlay()
1489
1493
  }, options.loading_overlay_duration);
1490
1494
  }
1491
-
1495
+
1492
1496
  if (options.cfilters && options.cfilters.length > 0) {
1493
1497
  var filterModel = {};
1494
1498
  const customFilters = options.cfilters
@@ -1589,6 +1593,14 @@ gridConfig.postSortRows = function (e) {
1589
1593
  const selectedRows = gridInstance.getSelectedRows();
1590
1594
  this.set('selectedRows', selectedRows);
1591
1595
  }
1596
+ onFilterTextBoxChanged = () => {
1597
+ if (gridInstance) {
1598
+ gridInstance.setGridOption(
1599
+ 'quickFilterText',
1600
+ document.getElementById(options.quick_filter_field).value
1601
+ );
1602
+ }
1603
+ }
1592
1604
  function updateHoveringBarStyles() {
1593
1605
  const existingStyle = document.getElementById('hovering-bar-style');
1594
1606
  if (options.fixed_horizontal_scroll) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cdmx/wappler_ag_grid",
3
- "version": "1.5.7",
3
+ "version": "1.5.9",
4
4
  "type": "module",
5
5
  "description": "App Connect module for AG Grid Table Generation.",
6
6
  "license": "MIT",