@cdmx/wappler_ag_grid 0.2.0 → 0.2.1
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/app_connect/components.hjson +68 -0
- package/dmx-ag-grid.js +9 -9
- package/package.json +1 -1
|
@@ -1046,6 +1046,74 @@
|
|
|
1046
1046
|
"allowedOn": {
|
|
1047
1047
|
"dmx-ag-grid": true
|
|
1048
1048
|
}
|
|
1049
|
+
},
|
|
1050
|
+
{
|
|
1051
|
+
"name": "dmx-ag-grid-edit-clicked",
|
|
1052
|
+
"attributeStartsWith": "dmx-on",
|
|
1053
|
+
"attribute": "row_action_edit",
|
|
1054
|
+
"display": "fieldset",
|
|
1055
|
+
"title": "Edit Clicked",
|
|
1056
|
+
"icon": "fa fa-lg fa-chevron-right",
|
|
1057
|
+
"groupTitle": "Grid Events",
|
|
1058
|
+
"groupIcon": "fa fa-lg fa-cubes",
|
|
1059
|
+
"defaultValue": false,
|
|
1060
|
+
"show": [
|
|
1061
|
+
"rowActionEdit"
|
|
1062
|
+
],
|
|
1063
|
+
"noChangeOnHide": true,
|
|
1064
|
+
"type": "boolean",
|
|
1065
|
+
"groupEnabler": true,
|
|
1066
|
+
"children": [
|
|
1067
|
+
{
|
|
1068
|
+
"name": "rowActionEdit",
|
|
1069
|
+
"attributeStartsWith": "dmx-on",
|
|
1070
|
+
"attribute": "row_action_edit",
|
|
1071
|
+
"isValue": true,
|
|
1072
|
+
"actionsPicker": true,
|
|
1073
|
+
"title": "Action:",
|
|
1074
|
+
"type": "text",
|
|
1075
|
+
"help": "Choose the action to execute.",
|
|
1076
|
+
"defaultValue": "",
|
|
1077
|
+
"initDisplay": "none"
|
|
1078
|
+
}
|
|
1079
|
+
],
|
|
1080
|
+
"allowedOn": {
|
|
1081
|
+
"dmx-ag-grid": true
|
|
1082
|
+
}
|
|
1083
|
+
},
|
|
1084
|
+
{
|
|
1085
|
+
"name": "dmx-ag-grid-view-clicked",
|
|
1086
|
+
"attributeStartsWith": "dmx-on",
|
|
1087
|
+
"attribute": "row_action_view",
|
|
1088
|
+
"display": "fieldset",
|
|
1089
|
+
"title": "View Clicked",
|
|
1090
|
+
"icon": "fa fa-lg fa-chevron-right",
|
|
1091
|
+
"groupTitle": "Grid Events",
|
|
1092
|
+
"groupIcon": "fa fa-lg fa-cubes",
|
|
1093
|
+
"defaultValue": false,
|
|
1094
|
+
"show": [
|
|
1095
|
+
"rowActionView"
|
|
1096
|
+
],
|
|
1097
|
+
"noChangeOnHide": true,
|
|
1098
|
+
"type": "boolean",
|
|
1099
|
+
"groupEnabler": true,
|
|
1100
|
+
"children": [
|
|
1101
|
+
{
|
|
1102
|
+
"name": "rowActionView",
|
|
1103
|
+
"attributeStartsWith": "dmx-on",
|
|
1104
|
+
"attribute": "row_action_view",
|
|
1105
|
+
"isValue": true,
|
|
1106
|
+
"actionsPicker": true,
|
|
1107
|
+
"title": "Action:",
|
|
1108
|
+
"type": "text",
|
|
1109
|
+
"help": "Choose the action to execute.",
|
|
1110
|
+
"defaultValue": "",
|
|
1111
|
+
"initDisplay": "none"
|
|
1112
|
+
}
|
|
1113
|
+
],
|
|
1114
|
+
"allowedOn": {
|
|
1115
|
+
"dmx-ag-grid": true
|
|
1116
|
+
}
|
|
1049
1117
|
}
|
|
1050
1118
|
],
|
|
1051
1119
|
"static_events": []
|
package/dmx-ag-grid.js
CHANGED
|
@@ -135,8 +135,6 @@ dmx.Component('ag-grid', {
|
|
|
135
135
|
|
|
136
136
|
let columnDefs = [];
|
|
137
137
|
let exportToCSV = this.props.exportToCSV;
|
|
138
|
-
console.log(this.props)
|
|
139
|
-
|
|
140
138
|
this.$node.innerHTML = `<div id=${gridId}-grid class="${grid_theme}"></div>`;
|
|
141
139
|
if (!rowData || rowData.length === 0) {
|
|
142
140
|
console.error('No row data provided.');
|
|
@@ -214,8 +212,12 @@ dmx.Component('ag-grid', {
|
|
|
214
212
|
button.setAttribute('title', buttonConfig.tooltip);
|
|
215
213
|
button.innerHTML = `<i class="${buttonConfig.icon}"></i> ${buttonConfig.action}`;
|
|
216
214
|
container.appendChild(button);
|
|
215
|
+
button.addEventListener('click', function () {
|
|
216
|
+
if (typeof buttonConfig.onClick === 'function') {
|
|
217
|
+
buttonConfig.onClick(params.data);
|
|
218
|
+
}
|
|
219
|
+
});
|
|
217
220
|
});
|
|
218
|
-
|
|
219
221
|
// Add spacing between buttons (margin-right)
|
|
220
222
|
const buttonSpacing = '5px'; // You can adjust the spacing as needed
|
|
221
223
|
const buttonsInContainer = container.querySelectorAll('button');
|
|
@@ -516,8 +518,7 @@ dmx.Component('ag-grid', {
|
|
|
516
518
|
onClick: (rowData) => {
|
|
517
519
|
this.set('data', rowData);
|
|
518
520
|
this.set('id', rowData.id);
|
|
519
|
-
this.dispatchEvent('
|
|
520
|
-
console.log('Custom Action 1 clicked for row with ID:', rowData.id);
|
|
521
|
+
this.dispatchEvent('row_action_edit');
|
|
521
522
|
},
|
|
522
523
|
},
|
|
523
524
|
{
|
|
@@ -528,8 +529,7 @@ dmx.Component('ag-grid', {
|
|
|
528
529
|
onClick: (rowData) => {
|
|
529
530
|
this.set('data', rowData);
|
|
530
531
|
this.set('id', rowData.id);
|
|
531
|
-
this.dispatchEvent('
|
|
532
|
-
console.log('Custom Action 2 clicked for row with ID:', rowData.id);
|
|
532
|
+
this.dispatchEvent('row_action_view');
|
|
533
533
|
},
|
|
534
534
|
},
|
|
535
535
|
// Add more custom buttons as needed
|
|
@@ -675,8 +675,8 @@ dmx.Component('ag-grid', {
|
|
|
675
675
|
row_checkbox_unchecked: Event,
|
|
676
676
|
row_status_enabled: Event,
|
|
677
677
|
row_status_disabled: Event,
|
|
678
|
-
|
|
679
|
-
|
|
678
|
+
row_action_edit: Event,
|
|
679
|
+
row_action_view: Event
|
|
680
680
|
},
|
|
681
681
|
|
|
682
682
|
render: function(node) {
|