@cdmx/wappler_ag_grid 0.0.3 → 0.0.4

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.
@@ -9,7 +9,7 @@
9
9
  "icon": "fa fa-lg fa-table",
10
10
  "state": "opened",
11
11
  "anyParent": true,
12
- "template": "<dmx-ag-grid id=\"@@id@@-grid\">\n<div id=\"@@id@@\" class=\"col ag-theme-alpine\">\n</div>\n</dmx-ag-grid>",
12
+ "template": "<dmx-ag-grid id=\"@@id@@\"></dmx-ag-grid>",
13
13
  "baseName": "aggrid",
14
14
  "help": "AG Grid component for data display",
15
15
  "dataScheme": [
@@ -56,35 +56,6 @@
56
56
  {
57
57
  "group": "AG Grid Options",
58
58
  "variables": [
59
- {
60
- "name": "defaultColDef",
61
- "attribute": "defaultColDef",
62
- "title": "Default Column Definition",
63
- "type": "object",
64
- "defaultValue": {},
65
- "help": "Default properties for all columns"
66
- },
67
- {
68
- "name": "columnTypes",
69
- "attribute": "columnTypes",
70
- "title": "Column Types",
71
- "type": "object",
72
- "defaultValue": {},
73
- "help": "Map of custom column types"
74
- },
75
- {
76
- "name": "rowSelection",
77
- "attribute": "rowSelection",
78
- "title": "Row Selection",
79
- "type": "string",
80
- "defaultValue": "single",
81
- "options": [
82
- "single",
83
- "multiple",
84
- "none"
85
- ],
86
- "help": "Defines the row selection mode"
87
- },
88
59
  {
89
60
  "name": "minWidth",
90
61
  "attribute": "minWidth",
package/dmx-ag-grid.js CHANGED
@@ -160,6 +160,9 @@ dmx.Component('ag-grid', {
160
160
  const dataChanges = this.props.data_changes;
161
161
  let columnDefs = [];
162
162
  let exportToCSV = this.props.exportToCSV;
163
+
164
+
165
+ this.$node.innerHTML = `<div id=${gridId +'-grid'}></div>`
163
166
  if (!rowData || rowData.length === 0) {
164
167
  console.error('No row data provided.');
165
168
  return;
@@ -423,10 +426,9 @@ const cstyles = this.props.cstyles
423
426
  rowData: rowData,
424
427
  ...gridOptions
425
428
  };
426
-
427
429
  // Create ag-Grid instance
428
430
  new agGrid.Grid(gridDiv, gridConfig);
429
- const gridElement = document.querySelector('.ag-theme-alpine');
431
+ const gridElement = document.getElementById(gridId+'-grid');
430
432
  const gridContainer = gridElement.parentNode;
431
433
 
432
434
  if (!gridContainer) {
@@ -486,13 +488,13 @@ const cstyles = this.props.cstyles
486
488
  'dmx-ag-grid-row-data-updated': Event
487
489
  },
488
490
 
489
- render: function () {
490
- // this.refreshGrid();
491
+ render: function(node) {
492
+ if (this.$node) {
493
+ this.$parse();
494
+ }
491
495
  },
492
496
 
493
497
  update: function (props) {
494
- // dmx.equal is a helper function the does a deep compare
495
- // which is useful when comparing arrays and objects
496
498
  if (!dmx.equal(this.props.data, props.data)) {
497
499
  this.refreshGrid();
498
500
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cdmx/wappler_ag_grid",
3
- "version": "0.0.3",
3
+ "version": "0.0.4",
4
4
  "type": "module",
5
5
  "description": "App Connect module for AG Grid Table Generation",
6
6
  "license": "MIT",