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

Custom button attributes #586

Open
gitkwarteng opened this issue May 18, 2024 · 0 comments
Open

Custom button attributes #586

gitkwarteng opened this issue May 18, 2024 · 0 comments

Comments

@gitkwarteng
Copy link

jquery-confirm version:
v3.x.x

I'm submitting a ...
[x ] feature request

Current behavior:
you can't set custom attributes on buttons.

Expected behavior:
set custom attributes on buttons

Related code:

                    save: {
                        text: 'Save',
                        btnClass: 'btn-secondary btn-lg mx-3',
                        attrs: {
                            'x-data': '{}',
                            'x-show': '$store.basket.isSettled'
                        },
                        action: function () {
                           
                        }
                    },
   } 

insert any relevant code here

// get custom attributes
 let attrs = that.buttons[key].attrs
 if (attrs) {
      $.each(attrs, function(key, value) {
            button_element.attr(key, value);
       });
 } 
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant