Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support dropdowns-dividers for row acrions. #18388

Merged
merged 2 commits into from Dec 7, 2023
Merged

Conversation

maliming
Copy link
Member

@maliming maliming commented Dec 6, 2023

Resolve #18377

image

abp.ui.extensions.entityActions.get('identity.user').addContributor(
    function(actionList) {
        return actionList.addManyTail(
            [
                {
                    text: l('Edit'),
                    visible: abp.auth.isGranted(
                        'AbpIdentity.Users.Update'
                    ),
                    action: function (data) {
                        _editModal.open({
                            id: data.record.id,
                        });
                    },
                },
                {
                    divider: true
                },
                {
                    text: l('Permissions'),
                    visible: abp.auth.isGranted(
                        'AbpIdentity.Users.ManagePermissions'
                    ),
                    action: function (data) {
                        _permissionsModal.open({
                            providerName: 'U',
                            providerKey: data.record.id,
                            providerKeyDisplayName: data.record.userName
                        });
                    },
                },
                {
                    divider: function () {
                        return `<li><hr class="dropdown-divider" style="border-block-color: blue;"></li>`;
                    },
                },
                {
                    text: l('Delete'),
                    visible: function(data) {
                        return abp.auth.isGranted('AbpIdentity.Users.Delete') && abp.currentUser.id !== data.id;
                    },
                    confirmMessage: function (data) {
                        return l(
                            'UserDeletionConfirmationMessage',
                            data.record.userName
                        );
                    },
                    action: function (data) {
                        _identityUserAppService
                            .delete(data.record.id)
                            .then(function () {
                                _dataTable.ajax.reloadEx();
                                abp.notify.success(l('SuccessfullyDeleted'));
                            });
                    },
                },
                {
                    divider: `<li><hr class="dropdown-divider" style="border-block-color: blue;"></li>`
                },
            ]
        );
    }
);

@rqx110
Copy link
Contributor

rqx110 commented Dec 7, 2023

I have an idea, can we change like this? divider can accept boolean and function

{
  divider: true,
},
{
   divider: function () {
        return `<li><hr class="dropdown-divider" style="border-block-color: blue;"></li>`;
   },
},

@realLiangshiwei realLiangshiwei merged commit d7502bd into dev Dec 7, 2023
2 checks passed
@realLiangshiwei realLiangshiwei deleted the datatables-divider branch December 7, 2023 02:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support dropdowns-dividers for row acrions.
3 participants