@cdmx/wappler_ag_grid 1.7.7 → 1.8.0
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/dmx-ag-grid.js +20 -10
- package/package.json +2 -2
package/dmx-ag-grid.js
CHANGED
|
@@ -1191,7 +1191,7 @@ dmx.Component('ag-grid', {
|
|
|
1191
1191
|
}
|
|
1192
1192
|
}
|
|
1193
1193
|
|
|
1194
|
-
|
|
1194
|
+
|
|
1195
1195
|
if (options.hide_sort) {
|
|
1196
1196
|
const hideSortArray = options.hide_sort.split(',');
|
|
1197
1197
|
if (hideSortArray.includes(key)) {
|
|
@@ -1230,7 +1230,7 @@ dmx.Component('ag-grid', {
|
|
|
1230
1230
|
}
|
|
1231
1231
|
}
|
|
1232
1232
|
function lookupValue(mappings, key) {
|
|
1233
|
-
if (key==''||key === undefined){
|
|
1233
|
+
if (mappings === undefined || key==''||key === undefined){
|
|
1234
1234
|
return options.cselect_placeholder
|
|
1235
1235
|
}
|
|
1236
1236
|
return mappings[key];
|
|
@@ -1239,6 +1239,8 @@ dmx.Component('ag-grid', {
|
|
|
1239
1239
|
editable = true;
|
|
1240
1240
|
cellEditor = 'agSelectCellEditor';
|
|
1241
1241
|
valueFormatter = (params) => {
|
|
1242
|
+
if (params.api.isDestroyed()) return;
|
|
1243
|
+
|
|
1242
1244
|
const selectedNode = params.api.getSelectedNodes()[0];
|
|
1243
1245
|
const dynamicOptions = options.cdynamic_select_editors[key];
|
|
1244
1246
|
const staticOptions = options.cstatic_select_editors[key];
|
|
@@ -1253,7 +1255,7 @@ dmx.Component('ag-grid', {
|
|
|
1253
1255
|
} else {
|
|
1254
1256
|
selectOptions = selectedNode?.data[dynamicOptions.options_field];
|
|
1255
1257
|
}
|
|
1256
|
-
|
|
1258
|
+
return lookupValue(selectOptions, params.value);
|
|
1257
1259
|
};
|
|
1258
1260
|
valueParser = (params) => {
|
|
1259
1261
|
return lookupKey(selectOptions, params.newValue);
|
|
@@ -1342,7 +1344,7 @@ dmx.Component('ag-grid', {
|
|
|
1342
1344
|
editable: false,
|
|
1343
1345
|
width: 50,
|
|
1344
1346
|
maxWidth: 50,
|
|
1345
|
-
|
|
1347
|
+
suppressHeaderMenuButton: true
|
|
1346
1348
|
};
|
|
1347
1349
|
columnDefs.unshift(checkboxColumn);
|
|
1348
1350
|
}
|
|
@@ -1446,7 +1448,7 @@ dmx.Component('ag-grid', {
|
|
|
1446
1448
|
localeText = AG_GRID_LOCALE_PT
|
|
1447
1449
|
}
|
|
1448
1450
|
const gridOptions = {
|
|
1449
|
-
...(idFieldPresent ? { getRowId: params => params.data.id } : {}),
|
|
1451
|
+
...(idFieldPresent ? { getRowId: params => String(params.data.id) } : {}),
|
|
1450
1452
|
columnDefs: (groupedColumnDefs && groupedColumnDefs.length > 0) ? groupedColumnDefs : columnDefs,
|
|
1451
1453
|
getRowStyle: options.rstyles ? createRowStyleFunction(options.rstyles): undefined,
|
|
1452
1454
|
localeText: localeText,
|
|
@@ -1491,7 +1493,7 @@ dmx.Component('ag-grid', {
|
|
|
1491
1493
|
suppressRowDeselection: this.props.suppress_row_deselection,
|
|
1492
1494
|
columnHoverHighlight: this.props.column_hover_highlight,
|
|
1493
1495
|
onFilterModified: function (params) {
|
|
1494
|
-
const columnApi = params.
|
|
1496
|
+
const columnApi = params.api;
|
|
1495
1497
|
columnApi.hideOverlay();
|
|
1496
1498
|
if (!params.api.filterManager.rowModel.rowsToDisplay.length) {
|
|
1497
1499
|
columnApi.showNoRowsOverlay();
|
|
@@ -1500,7 +1502,7 @@ dmx.Component('ag-grid', {
|
|
|
1500
1502
|
}
|
|
1501
1503
|
},
|
|
1502
1504
|
onGridReady: (params) => {
|
|
1503
|
-
const columnApi = params.
|
|
1505
|
+
const columnApi = params.api;
|
|
1504
1506
|
if (options.csort && options.csort.length > 0) {
|
|
1505
1507
|
let sortModel = options.csort.map(function(sortItem, index) {
|
|
1506
1508
|
return {
|
|
@@ -1673,7 +1675,7 @@ dmx.Component('ag-grid', {
|
|
|
1673
1675
|
gridInstance = agGrid.createGrid(gridDiv, gridConfig);
|
|
1674
1676
|
gridInstance.setGridOption('rowData', rowData)
|
|
1675
1677
|
if (options.loading_overlay) {
|
|
1676
|
-
gridInstance.
|
|
1678
|
+
gridInstance.setGridOption("loading", true)
|
|
1677
1679
|
setTimeout(() => {
|
|
1678
1680
|
gridInstance.hideOverlay()
|
|
1679
1681
|
}, options.loading_overlay_duration);
|
|
@@ -1880,8 +1882,16 @@ dmx.Component('ag-grid', {
|
|
|
1880
1882
|
const cellRenderer = columnDef.cellRenderer;
|
|
1881
1883
|
// Apply cellRenderer if it exists
|
|
1882
1884
|
if (cellRenderer && typeof cellRenderer === "function") {
|
|
1883
|
-
const
|
|
1884
|
-
|
|
1885
|
+
const cellRendererParams = {
|
|
1886
|
+
value: params.value,
|
|
1887
|
+
data: params.node.data,
|
|
1888
|
+
node: params.node,
|
|
1889
|
+
colDef: columnDef,
|
|
1890
|
+
column: params.column,
|
|
1891
|
+
api: params.api,
|
|
1892
|
+
context: params.context,
|
|
1893
|
+
};
|
|
1894
|
+
const cellRendererValue = cellRenderer(cellRendererParams);
|
|
1885
1895
|
return cellRendererValue;
|
|
1886
1896
|
}
|
|
1887
1897
|
else if (valueFormatter && typeof valueFormatter === "function") {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cdmx/wappler_ag_grid",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.8.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "App Connect module for AG Grid Table Generation.",
|
|
6
6
|
"license": "MIT",
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"ag-grid"
|
|
15
15
|
],
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"ag-grid-community": "~
|
|
17
|
+
"ag-grid-community": "~32.0.0",
|
|
18
18
|
"exceljs": "4.4.x",
|
|
19
19
|
"papaparse": "5.4.x"
|
|
20
20
|
},
|