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

w2Popup - Multiple Custom Buttons #2532

Closed
MikeGriffinReborn opened this issue Jun 18, 2024 · 1 comment
Closed

w2Popup - Multiple Custom Buttons #2532

MikeGriffinReborn opened this issue Jun 18, 2024 · 1 comment

Comments

@MikeGriffinReborn
Copy link

The "Custom" property of Options on the Popup should have been an Array [] ? Why can we only have 1 custom button?

@vitmalina
Copy link
Owner

You can create as many custom buttons as you wish, here is another example

 w2popup.open('Some text', {
        actions: {
            // function name is used for button text
            Ok(event) {
                // do something
                w2popup.close()
            },
            Cancel(event) {
                w2popup.close()
            },
            // custom button, when you can define text and class
            custom1: {
                text: "Other Button",
                class: "w2ui-btn-blue",
                style: 'color: yellow',
                onClick(event) {
                    console.log('button clicked')
                }
            },
            custom2: {
                text: "Custom 2",
                onClick(event) {
                    console.log('button clicked')
                }
            },
        }
    })

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

2 participants