@cdmx/wappler_ag_grid 1.2.3 → 1.2.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.
- package/README.md +19 -56
- package/dmx-ag-grid.js +9 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -259,6 +259,9 @@ The Configure Actions Column feature allows you to configure actions for the but
|
|
|
259
259
|
**Enable Actions**
|
|
260
260
|
This will display the "Configure Actions" options for the buttons in the Actions Column.
|
|
261
261
|
|
|
262
|
+
Note: Button Tooltip Supports Calling a function, just define a function and add the function name in the Tooltip e.g. getEditTooltip().
|
|
263
|
+
In the function the variable for the row data will be available as the first attribute e.g. getEditTooltip(data), then data holds the values of the row.
|
|
264
|
+
|
|
262
265
|
**Pin Actions Column**
|
|
263
266
|
This will keep the Actions Column fixed when scrolling horizontally.
|
|
264
267
|
|
|
@@ -288,7 +291,7 @@ Specify the CSS class for styling the Edit Action button.
|
|
|
288
291
|
Specify the CSS class for styling the icon of the Edit Action button.
|
|
289
292
|
|
|
290
293
|
**Edit Action Button Condition**
|
|
291
|
-
Specify the condition to Show the Edit Action button, eg: code==TEST, or status==COMPLETED
|
|
294
|
+
Specify the condition to Show the Edit Action button, eg: code==TEST, or status==COMPLETED||status==FINISHED or status==COMPLETED&&user_status==true
|
|
292
295
|
|
|
293
296
|
**View Action Button**
|
|
294
297
|
This will display the "View Action Button" options.
|
|
@@ -306,7 +309,7 @@ Specify the CSS class for styling the View Action button.
|
|
|
306
309
|
Specify the CSS class for styling the icon of the View Action button.
|
|
307
310
|
|
|
308
311
|
**View Action Button Condition**
|
|
309
|
-
Specify the condition to Show the View Action button, eg: code==TEST, or status==COMPLETED
|
|
312
|
+
Specify the condition to Show the View Action button, eg: code==TEST, or status==COMPLETED||status==FINISHED or status==COMPLETED&&user_status==true
|
|
310
313
|
|
|
311
314
|
**Delete Action Button**
|
|
312
315
|
This will display the "Delete Action Button" options.
|
|
@@ -324,69 +327,29 @@ Specify the CSS class for styling the Delete Action button.
|
|
|
324
327
|
Specify the CSS class for styling the icon of the Delete Action button.
|
|
325
328
|
|
|
326
329
|
**Delete Action Button Condition**
|
|
327
|
-
Specify the condition to Show the Delete Action button, eg: code==TEST, or status==COMPLETED
|
|
330
|
+
Specify the condition to Show the Delete Action button, eg: code==TEST, or status==COMPLETED||status==FINISHED or status==COMPLETED&&user_status==true
|
|
328
331
|
|
|
329
332
|
# Custom Action Buttons
|
|
330
333
|
|
|
331
|
-
**
|
|
332
|
-
Specify the CSS class for Button 1.
|
|
333
|
-
|
|
334
|
-
**Button1 Tooltip**
|
|
335
|
-
Specify the tooltip text for Button 1.
|
|
336
|
-
|
|
337
|
-
**Button2 Class**
|
|
338
|
-
Specify the CSS class for Button 2.
|
|
339
|
-
|
|
340
|
-
**Button2 Tooltip**
|
|
341
|
-
Specify the tooltip text for Button 2.
|
|
342
|
-
|
|
343
|
-
**Button3 Class**
|
|
344
|
-
Specify the CSS class for Button 3.
|
|
345
|
-
|
|
346
|
-
**Button3 Tooltip**
|
|
347
|
-
Specify the tooltip text for Button 3.
|
|
348
|
-
|
|
349
|
-
**Button4 Class**
|
|
350
|
-
Specify the CSS class for Button 4.
|
|
351
|
-
|
|
352
|
-
**Button4 Tooltip**
|
|
353
|
-
Specify the tooltip text for Button 4.
|
|
354
|
-
|
|
355
|
-
**Button5 Class**
|
|
356
|
-
Specify the CSS class for Button 5.
|
|
357
|
-
|
|
358
|
-
**Button5 Tooltip**
|
|
359
|
-
Specify the tooltip text for Button 5.
|
|
360
|
-
|
|
361
|
-
**Button6 Class**
|
|
362
|
-
Specify the CSS class for Button 6.
|
|
363
|
-
|
|
364
|
-
**Button6 Tooltip**
|
|
365
|
-
Specify the tooltip text for Button 6.
|
|
366
|
-
|
|
367
|
-
**Button7 Class**
|
|
368
|
-
Specify the CSS class for Button 7.
|
|
369
|
-
|
|
370
|
-
**Button7 Tooltip**
|
|
371
|
-
Specify the tooltip text for Button 7.
|
|
334
|
+
**Buttons 1-10**
|
|
372
335
|
|
|
373
|
-
**
|
|
374
|
-
|
|
336
|
+
**Button[i] Action Button**
|
|
337
|
+
This will display the "Button[i] Action Button" options.
|
|
375
338
|
|
|
376
|
-
**
|
|
377
|
-
Specify the
|
|
339
|
+
**Button[i] Action Button Title**
|
|
340
|
+
Specify the title for the Button[i] Action button.
|
|
378
341
|
|
|
379
|
-
**
|
|
380
|
-
Specify the
|
|
342
|
+
**Button[i] Action Button Tooltip**
|
|
343
|
+
Specify the tooltip text for the Button[i] Action button.
|
|
381
344
|
|
|
382
|
-
**
|
|
383
|
-
Specify the
|
|
345
|
+
**Button[i] Action Button Class**
|
|
346
|
+
Specify the CSS class for styling the Button[i] Action button.
|
|
384
347
|
|
|
385
|
-
**
|
|
386
|
-
Specify the CSS class for Button
|
|
348
|
+
**Button[i] Action Button Icon Class**
|
|
349
|
+
Specify the CSS class for styling the icon of the Button[i] Action button.
|
|
387
350
|
|
|
388
|
-
**
|
|
389
|
-
Specify the
|
|
351
|
+
**Button[i] Action Button Condition**
|
|
352
|
+
Specify the condition to Show the Button[i] Action button, eg: code==TEST, or status==COMPLETED||status==FINISHED or status==COMPLETED&&user_status==true
|
|
390
353
|
|
|
391
354
|
# Action Attributes
|
|
392
355
|
|
package/dmx-ag-grid.js
CHANGED
|
@@ -464,14 +464,21 @@ dmx.Component('ag-grid', {
|
|
|
464
464
|
const buttons = params.buttons || defaultButtons;
|
|
465
465
|
// Create a new container element to hold the buttons
|
|
466
466
|
const container = document.createElement('div');
|
|
467
|
-
|
|
467
|
+
|
|
468
468
|
buttons.forEach((buttonConfig) => {
|
|
469
469
|
const button = document.createElement('button');
|
|
470
470
|
button.classList.add('btn');
|
|
471
471
|
const classNames = buttonConfig.classNames.split(' ');
|
|
472
472
|
classNames.forEach((className) => button.classList.add(className));
|
|
473
473
|
button.setAttribute('data-toggle', 'tooltip');
|
|
474
|
-
|
|
474
|
+
// Call a function to get the dynamic tooltip content
|
|
475
|
+
if (buttonConfig.tooltip.endsWith('()')) {
|
|
476
|
+
const tooltipFunction = buttonConfig.tooltip.slice(0, -2); // Remove the trailing '()'
|
|
477
|
+
const tooltipText = window[tooltipFunction](params.data)
|
|
478
|
+
button.setAttribute('title', tooltipText);
|
|
479
|
+
} else {
|
|
480
|
+
button.setAttribute('title', buttonConfig.tooltip);
|
|
481
|
+
}
|
|
475
482
|
button.innerHTML = `<i class="${buttonConfig.icon}"></i> ${buttonConfig.action}`;
|
|
476
483
|
container.appendChild(button);
|
|
477
484
|
// Check if the button should be hidden based on the condition string and row data
|