Issue #785Opened January 22, 2018by lypliuyinping0 reactions

make a button component

Question

Hello, I want to do a button component, click on the button, it will pop up a dialog box that contains some text boxes and OK and Cancel button, click OK and Cancel button will perform different functions, may I ask how to achieve this? Thank you for your answer

Answers (3)

JulyanoFJanuary 22, 20180 reactions

Hello @lypliuyinping You can create custom blocks like this:

var customBlock = {
            label: 'Button',
            attributes: {
                class: "gjs-fonts gjs-f-button"
            },
            content: "<button class='btn btn-success' >Button</button>",
            id: "myButtonId"
        };
editor.BlockManager.add(customBlock.id, customBlock);
lypliuyinpingJanuary 22, 20180 reactions

@JulyanoF Firstly, thank you very much for your reply! Then, I would like to ask, how to achieve the button click event? For example: Click the button to bring up the text box.

JulyanoFJanuary 22, 20180 reactions

Are you using bootstrap? Or another js lib to create a dialog box?

Related Questions and Answers

Continue research with similar issue discussions.

Paid Plugins That Match This Issue

Curated by issue keywords and label relevance to help you ship faster.

View all plugins

Loading paid plugin recommendations...

Browse Plugin Categories

Jump directly to plugin category pages on the marketplace.