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)
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);
@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.
Are you using bootstrap? Or another js lib to create a dialog box?
Related Questions and Answers
Continue research with similar issue discussions.
Issue #2004
[QUESTIONS] Add Component(from BlockManager) into Modal
i want to make a button that displays modal, then i can add some component / block into the modal.
Issue #1639
[Question]: Would it be possible to have change settings under style manager in a way that it has href when a link is created?
I'm using preset newsletter with built-in RTE (do not want to use ck editor like the demo) In order to make any text to link, i need to cli...
Issue #1576
Select element that has several blocks as one unit.
I've created new block (like form or dialog, etc) that has several blocks such as search box, button, text fields, ... This element doesn't...
Issue #460
When the component's view modifies the HTML, text components are no longer editable
I'm trying to build a custom component that contains some lorem ipsum text in the content, for editing once it's on the canvas. But I also...
Paid Plugins That Match This Issue
Curated by issue keywords and label relevance to help you ship faster.
Loading paid plugin recommendations...
Browse Plugin Categories
Jump directly to plugin category pages on the marketplace.