Issue #1573💬 AnsweredOpened November 12, 2018by crypto-dump1 reactions

Open modal after drop element

快速解答by mcsekar121

Please check the docs https://grapesjs.com/docs/api/modal_dialog.html#modal use Modal.setContent();

Read full answer below ↓

Question

How to show custom modal dialog when drop element on editor? like asset modal dialog appears when drop image block to the editor.

Answers (3)

mcsekar12November 13, 2018
代码片段TEXT
Use Editor events 
[https://grapesjs.com/docs/api/editor.html#available-events](https://grapesjs.com/docs/api/editor.html#available-events)
`editor.on('component:add', (model, argument) => {
        //filter using component name       
        if (model.getName() === 'modelName') {
          //show modal
        }
        //filter using css Class
        if (model.getAttrToHTML().class === 'className') {
          //show model
        }
      });`
crypto-dumpNovember 13, 2018

Thanks. I'm new to this plugin. How to create my own modal dialog that has checkbox or select options or etc ?

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...

Free option

Check the open-source GrapesJS plugins on GitHub or run a quick search in our free catalog.

Browse free plugins →
Premium option

Premium plugins ship with support, regular updates, and production-ready features — save days of integration work.

Browse premium plugins →

Related tutorials

In-depth guides on the same topic.

All tutorials →

Browse Plugin Categories

Jump directly to plugin category pages on the marketplace.