I have a component and a block defined inside my plugin. The block relies on fetching some data via AJAX and then re-rendering itself. When I d&d block to the editor canvas all works nice. But once I load the stored data, script is not executed. It can be seen in the image that component type is saved and loaded corre...
I'm passing following JSON to editor.BlockManager.add() function to define my block, load it's content from the server and populate select-type trait named defaultCategory in the same manner. Everything works nice. Now I need to listen to onchange event of that select and execute some JS there. I've consulted https://...
Hi, i want to have multiple pages whith shared styles. But when i'm switching between pages, it replaces not only components but also css rules and stores css rules separately. Are there any way to have shared styles? UPD: Managed to implement in different way/ Closed
etamity
@makkaronis4e Could you share how did you implemented? Thank you.
Hi! Thanks for your work @artf. This is a simplified code of how I use grapesjs, I want to save the styles and then want to apply them again. The problem is that ids already changed in DOM after first call of container.components() so styles will not be applied. How to prevent this behavior? What should I clear/reset?
pouyamiralayi
Hi @nikita-balakirev see if #2706 comment can help you. Cheers!
ghost
I fixed it now using editor.DomComponents.componentsById = {}; but I think it can lead to collisions between blocks at some point what do you think?
artf
Sorry @nikita-balakirev can't help you here without a complete reproducible example. When you export components as JSON all IDs are preserved and reused if load correctly, so for sure you're doing something wrong with storing/loading data....
Hello, @artf , I've catch a bug at built-in RTE:added standart email text element with a red styled tag a inside:enable rte by doubleclick on span elementdisable rte by deselecting elementthe link is blue now It adds "-2" to link's id after every time I deselect it. I think the problem starts at dom_components/view/Co...
Hi All, More of a general question of if anyone has managed to make the whole canvas (or in fact the wrapper) a Vue element, meaning that you could drag some a custom div like '<timer></timer>' and it renders correctly? I've attempted this, I made the wrapper the vue element (el), and it did work when 'importing' HTML...
adamwpe
Thanks @noogen for your detailed reply. Yh, think you are right and stick with components - I'm not too sure if the ToHtml if the right solution is for me or not, because I don't want to manage two types of system, on rending correctly wit...
noogen
My answer is to best stick with custom scripts. I've done custom components using lodash template here: https://github.com/niiknow/grapesjs-components-farmer/blob/master/src/index.js#L2. A string is expected from thetoHtml method - https:/...
Are you using the latest release (older versions are NOT supported)? Yes, using latest v0.16.3 version. What happen? Upgraded from WORKING v0.15.3 to v0.16.3. Also, went back and verify that this is WORKING in v0.15.10 Demo to reproduce the problem https://niiknow.github.io/grapesjs-components-farmer/ in latest Firefo...
artf
@noogen can you please create a reproducible demo on something like jsfiddle? (without your preset/plugin, so I know the issue comes from the core)
no-response[bot]
This issue has been automatically closed because there has been no response to our request for more information from the original author. With only the information that is currently in the issue, we don't have enough information to take ac...
HassanElZarkawy
I'm also having this issue. With me it happens whenever i try to canvas option in init. When i remove the canvas config part in the options everything seems to work fine.
I have integrated the code edit option in the Web builder.Using editor.getHtml() to get the current HTML content and populate in the code editorWhile saving the code from the code editor, I am using editor.setComponents() to set the edited content to the builder canvas. IssuesOn Saving the html from the code editor, i...
pouyamiralayi
@jenter #1331 comment and #2644 comment are good examples. Also checkout #2664 comment which is a pitfall to avoid! Cheers!
noogen
@sathyanarayananaCES First, to echo others that it is best to use get/setComponents and get/setStyle to save the content of the editor. If I understand your usage correctly, that you want HTML for htmlCodeEditor and be able to import back...
pouyamiralayi
Hi @sathyanarayananaCES you must call `editor.getComponents and editor.getStyle in order to retrieve the components details; then you can return to the stored state by calling editor.setComponents and editor.setStyle` with the result of ab...
Hi All, I'm trying to test adding some custom Vue.js components to the block manager, and at first appearance, all is well - it renders correctly and vue components are responsive. But if I save the template, and reload my page, and supply the storageManager with 'gjs-style', 'gjs-components', 'gjs-html', 'gjs-css'. T...
adamwpe
@pouyamiralayi Thanks for that, pointed me in the right direction - so he is an example that works for me for rending a Vue Component and it will load back in :), but sure may be useful for someone else: Thanks for the help everyone!
mcottret
Hi @adamwpe ! Script tag importing is disabled by the default editor configuration, which explains why your scripts tags are stripped out by the HTML Parser, setting the allowScripts editor configuration option to true should solve the iss...
pouyamiralayi
@adamwpe we had something like this in the past i apologize for not seeing it through! go like this: there is no need to extend from dView & dModel in the latest versions. and for the vue js integration please notice that the internal stru...
[Question:] Hi, I have used this builder plugin in angular 7. This is very well structured and extendable. But I have some issue in define custom components this plugin. The Question is How to add Classes to custom DomComponent. I have created new video wrapper dom component. This contains iframe inside of them. I wan...
artf
Can you create a live demo with the complete code of your custom component, please?
no-response[bot]
This issue has been automatically closed because there has been no response to our request for more information from the original author. With only the information that is currently in the issue, we don't have enough information to take ac...