GrapesJS Issues

3,464 parsed GitHub issues — 370 solved · 90 open. Search, filter and explore battle-tested answers.

829 issues found

🔍 question
#2554February 7, 2020by irfanhaider51 answer
0 reactions

[QUESTION] Create dynamic table with dynamic data from server

Hi , I want to make dynamic component using table with dynamic data.And want to render generated html in react component.Will you please help me out how can I do that I didn’t find any thing that help me out.I m stuck.

artf

You need to create a custom component and you could load the dynamic data in onRender callback function

#2552February 6, 2020by kickbk2 answers
2 reactions

Only allow one component to be dropped

Sorry for the newbie question, but say I have a text field component and I only want to allow the user to drop a specific number of them into the canvas, say just one. How do I limit it? Perhaps a way that shows an alert to explain they cannot add another text field component to the canvas unless they remove the exist...

pouyamiralayi

#25151 #25152

kickbk

So I have a very ugly solution right now: This basically looks whether the component is in the canvas on load. If it is then it hides the draggable component button - Here I could use a better way to hide the button - how? I can get to the...

#2550February 5, 2020by ganapathy-kevin1 answer
0 reactions

[QUESTION] Firing a function "on type" event

Is there an event listener I can use to fire a function as the user is typing each letter into a Grapejs field? I'm looking to save to a remote database as the user is typing each letter. Currently I can only fire a function on blur, or if the user presses a custom button.

artf

if you use blur you can probably use input(triggers on any input change) too

#2549February 4, 2020by rjrodriguezalvarez973 answers
7 reactions

[QUESTION] Update component view on property change

Hi everyone, I'm trying to create a component that will update it's view based on a property value My approach is bassed on #1227 and on the docs In my use case I don't need the trait, I can just update the property programmatically. But this won't work and will not display any component on the canvas even though they...

artf

to update the HTML you have to change toHTML in the model

artf

Did you try something like this?

rjrodriguezalvarez97

I’ll give it a try the day after tomorrow. Thanks for your quick replies!

#2542February 1, 2020by erikhaw1 answer
3 reactions

[Question] Image-like component with own asset manager

Hi everyone! I have a question about my problem, which I want to solve for about 1 month. The question is: Can I create a component, like a image component, so when I drop it, it will open my own asset manager, that will not overwrite original asset manager, so Image component will have same functionality as it has no...

artf

You just need to create your own command which calls your modal. Obviously, as you're implementing your own Asset Manager it's up to you knowing WHEN to update the target For your custom image component you could do something like this: Wh...

#2541January 31, 2020by andy-aware3 answers
0 reactions

[Question] Assign style to class not ID

What I'm trying to achieve is whenever the "block" inside of the canvas is edited the style isn't added to an #id but instead added to a class. My logic is to take the current ID that is used - the random string and remove it as the ID and make it a class and then assign styles to that class instead of the ID, yes it'...

artf

Just create blocks/components with classes and, by default, the Style Manager will apply styles to them

Fahad-ishfaq

Just create blocks/components with classes and, by default, the Style Manager will apply styles to them Hi! Can you please tell if we can switch off this behaviour. I want to editor to setup CSS style to element id instead of class names....

artf

@Fahad-ishfaq https://grapesjs.com/docs/modules/Selectors.html#component-first-selectors

#2540January 31, 2020by SNaushadS3 answers
4 reactions

[Question] Getting started

I am a designer, i want to try around GrapeJS. My understanding is that i can use GrapeJS locally similar to that of WordPress. I am familiar with Commandline and followed the Docs to install npm followed by installing grape js.. and i dont know what else to do so that i can try it. WOuld be helpful if there is some f...

pouyamiralayi

@SNaushadS grapesjs is a template builder so it can be integrated into wordpress or any other cms out there. See this one as an example of integration for october cms Please visit the getting_started guide to become familiar with the basic...

artf

@SNaushadS GrapesJS might be a good base for building something like that

SNaushadS

@pouyamiralayi thanks for the reply. to clarify further, grapejs is not something which can be used like pinegrow .

#2539January 31, 2020by ayana303 answers
1 reactions

how to display and upload images from an api ?

WARNING READ and FOLLOW next 5 steps, then REMOVE them before posting the issueFollow CONTRIBUTING Guidelines https://github.com/artf/grapesjs/blob/master/CONTRIBUTING.mdUse the GitHub Issues EXCLUSIVELY for BUGS, FEATURE REQUESTS or QUESTIONS. Prefix the title of the issue with its context, eg. [Bug]: ....Do a quick...

pouyamiralayi

@ayana30 you can append them to the global category, check out more on this here Cheers!

pouyamiralayi

@ayana30 please refer to uploading assets Cheers!

ayana30

am trying to list images here by using unsplash api.

#2537January 30, 2020by eyeamkd2 answers
2 reactions

[Question] How to make a block that could drop inline with a text block ?

I need to create an element, that probably is of span type, but the user need to drop it inline with a text. How can i achieve this functionality? To elaborate further, this block of mine, should have the property that could enable it to be inserted anywhere inside already defined text blocks

pouyamiralayi

Hi @eyeamkd you need to set `textable property of your custom component type to true`. here is more info custom component docs Cheers!

eyeamkd

Thanks!!

#2536January 29, 2020by andy-aware3 answers
3 reactions

[Question] Background Image inline

Hi, Reading through the documentation, I can't find anywhere that explains what I'm looking to do. Currently, Grapes grabs the background image and puts it into the style, but I want to take this image and not add it to a background style, I want to put it into a data-element on the element that is selected. I've been...

pouyamiralayi

Hi @awaredigital StyleManager targets both Components and CssRules, so do it like below: Cheers!

andy-aware

That is great. How do i stop the data of model.getStyle()['background-image'] being passed into the CSS? Only the background image. Thanks

pouyamiralayi

@awaredigital i have tested the above code and it was working fine. but for the error, you may check `bg` before further processing because after we update the component style we may get the callback again which is your case here: Cheers!