grapesjs icon indicating copy to clipboard operation
grapesjs copied to clipboard

Few Questions

Open Amir2828 opened this issue 7 years ago • 4 comments

First of all, Amazing project thumbs up to everybody involved.

I have a couple of questions:

  1. How can I iterate over all of the components and change their content on the canvas. I would like to implement a find and replace function that will replace a specific string in all of the Elements inside the canvas.

  2. Is there any good way to edit items that are dependent on Js for example collapsibles like Accordion or even a Carousel Element. I would like to detect and trigger the accordion event on Canvas in order to edit the hidden content. Is there anyway to maybe find items which have specific types of event listeners and then activate them on click/keymap etc.. Another option is to open a modal with the hidden content for edit and edit through the modal.

Help will be appreciated =)

Amir2828 avatar Jun 05 '19 14:06 Amir2828

Ok I Managed to solve the 1st problem. I used get components and recursively iterated on the tree. When I finished I used the DomComponents.render()

Still looking for some direction regarding the 2nd question

Amir2828 avatar Jun 06 '19 13:06 Amir2828

Ok I think I also managed to figure out the 2nd question. I injected to the Canvas JQuery script which made the Accordions and Sliders Behave as expected.

Amir2828 avatar Jun 11 '19 08:06 Amir2828

Hi @Amir2828 , Can you tell me about the accordion? Can you give a small example?

Amitkumar85533 avatar Nov 07 '19 12:11 Amitkumar85533

Hi @Amir2828 Could you please help with a guide on accordion and carousel. Thank you

inidaname avatar Jan 07 '25 12:01 inidaname