Bug in setActionButtonMultiple

When I use setActionButtonMultiple function in version 3.x the ‘Delete’ button for the ‘multi’ action also shows up without being set. I believe this is now how it was intended to function, it should be a bug.

Also is there a way to unset an action button for a single record eg a record is approved and you do not want the approve button to show on that record , in version 2 I used to set a, empty url value then use javascript to hide button with empty url but in version 3.x it seems I cannot interact on the datatable records with javascript.

Hello @lev ,

I confirm that this is a bug and I will try to fix that for the next version.

In order to add a JavaScript callback you should use: unsetAutoloadJavaScript | Grocery CRUD v3 and then add your JavaScript callback as per example here:

    actionButtonsMultiple: [{
        iconCssClass: 'fa fa-smile-o',
        label: 'Smiley',
        onClick: function ({selectedIds}) {
            console.log('Smiley selected ids: ' + selectedIds);
        }
    }],

Unfortunately it seems that this is visible only when you enable the delete functionality. I will try to update this bug and fix it the soonest possible. I will let you know once this fix is available :slight_smile:

Regards
Johnny

Hello @lev ,

I am glad to inform you that this is now fixed on the latest version 3.0.18

Most probably the last version of 2023 :slight_smile:

Enjoy
Johnny

Hello @johnny ,

The bug in ‘setActionButtonMultiple’ is fixed on the new release, I have also been able to sort my issue of interacting with datatable line items by using ‘unsetAutoloadJavaScript()’. Thank you, and have a Happy New Year!!

1 Like