GrapesJS Issues

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

829 issues found

🔍 question
#1141May 29, 2018by inventorbit2 answers
2 reactions

[Question] - How to extend the existing traits and render the changes in canvas?

I am trying to write a plugin to manage all the element properties of Boostrap Blocks. If someone clicks on the button it will show button related properties like button colors, size, etc... (based on default bootstrap classes) The following code - modifies the button classes and settings got stored in the model howev...

artf

You don't need to update the view in this case, just change the classes inside the model. All you need is this

lock[bot]

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

#1138May 28, 2018by dinhjeffrey2 answers
0 reactions

[Question] Only showing "Block" element under Block Manager

Not sure if it's suppose to be like this but I git cloned the repo and npm start. I can only see the "Block" element; cannot see Links, Videos, Sections, Text, Quotes, etc. elements. How do these other elements in the Block Manager?

JulyanoF

@dinhjeffrey you need to install this extension: Basic Blocks

lock[bot]

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

#1137May 27, 2018by shareefhiasat3 answers
2 reactions

Cant make Text Block not editable and style able at the same time !

Demo / reproduce problem https://jsfiddle.net/shareefhiasat/u8Lodyh7/1/ Question Not sure if its bug or i dont know how to get the desired behaviour Expected I need text element like, and be able to style it but NOT changing what content (text in it) Actual and What i have Tried I tried from wiki and docs some solutio...

shareefhiasat

@artf yes its working my friend , thanks a million here how it is now for future reference , fiddle you cant edit , but you can style https://jsfiddle.net/shareefhiasat/jdpkccz0/ You can close it, Regards

shareefhiasat

UPDATE for future reference , i updated jsfiddle with editable and none editable component example, note that the appearance and behavior of hovering over elements dose not work with its not editable

shareefhiasat

@julyanof @artf Please help may be it too simple to figure out my self

#1135May 25, 2018by JulyanoF3 answers
0 reactions

[Question] Two html tags as one (link/button)

Is it possible to have two elements (div and lnik) and consider as a single? For example: there is the my following link block: <div class="row"><a class="btn" href="http://test.com">Link Here</a></div> And I would like that on click div or button, it shows the <a> as a selected element on editor views, but in wrapper...

artf

You should create a custom component

JulyanoF

@artf I tried extending original link component, but it seems not working It's not changing anything.. I already tried to disable autorender and render after all changes. I could change the content only setting a new, using BlockManager: b...

JulyanoF

@artf as you said, I tried to use Components, but I didn't get expected result. Could you help me? My link block prints this content: <div style="height:45px;margin:0 auto 10px auto;padding: 5px 5px 5px 5px;width: 100%;text-align:center"><...

#1132May 25, 2018by agungjanuar3 answers
0 reactions

[Question] How do I get <body> tag and its attributes

I have set the background-color for body. But when it will be edit code or export data using command editor.runCommand ('gjs-get-inlined-html'); there is no attribute for body that has been set. How do I solve for the body tag to retrieve when using that command? Or is there another way? Image when set background-colo...

artf

There is an option for it

agungjanuar

Thanks @artf , it works :)

lock[bot]

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

#1126May 22, 2018by faizansaiyed3 answers
1 reactions

[Question] How to Add Custom attribute in a Block through Block Manager?

Hello, I have a custom block in which there is custom attribute @call-method="searchProduct". But when I directly use this in Grapes JS as <datafieldsearch @call-method="searchProduct" label="Search"></datafieldsearch> it throws an error saying Uncaught DOMException: Failed to execute 'setAttribute' on 'Element': '@ca...

faizansaiyed

Thanks, actually I found alternative to @ i.e. v-on for using @ in VueJS

d3vr

You can't use @ in an attribute's name, use something like data-call-method instead

lock[bot]

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

#1123May 21, 2018by alfaalex813 answers
0 reactions

[QUESTION] Onload event inside template

Hi! I have a problem with some templates. This template has some scripts running after the page is loaded. When this templates is loaded by GrapeJs, the scripts do not starting because browser not detect the ending of load. It's possibile to load templete in a classic iframe (not injected)? For example: <iframe src="h...

artf

Have you tried with this?

alfaalex81

Sure, other scripts with "allowScripts" parameter work fine, but scripts inside "on load event" don't. I inject the code in this way: var newComps = editor.DomComponents; $.get('http://myexamplepages.com', function (e) { newComps.setCompon...

artf

@alfaalex81 can you provide a live demo of the issue?

#1118May 17, 2018by cgatian3 answers
0 reactions

[Question] Generate dynamic identifier in Block

Im looking to create a block that when dropped will generate two components and these components would share some unique identifier between each other. If I dropped a second block to the canvas a second identifier would be used. I believe you could do this by creating your own component, but then you loose the ability...

artf

You can make use of this event

cgatian

@artf Thank you for the reply! OK I was second guessing this approach, good to get some feedback on this. Just to follow up I dont believe there's a way to detect which block was actually dropped during the event, correct?

artf

Just to follow up I dont believe there's a way to detect which block was actually dropped during the event, correct? The component it's just the first one of your list, if you wrap your 2 elements inside another div that one will be the dr...

#1113May 14, 2018by trinhbalinh3 answers
1 reactions

[QUESTIONS] New trait type is not working with rendered components?

Hello, thanks for the great framework. I'm trying to apply this to my project. I want to add a new trait for existing LINK '<a>' component. I follow these documents and almost got what I expected: https://github.com/artf/grapesjs/wiki/Traits#define-new-trait-type and: https://github.com/artf/grapesjs/wiki/Components#u...

artf

Just include your changes in a plugin https://jsfiddle.net/on1g5xqb/

trinhbalinh

Thank you, it worked!

lock[bot]

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

#1112May 14, 2018by IceCrystal0k2 answers
0 reactions

[Question]How to add a new event to asset images

Hello, is there a way to add a new event to the AssetImageView, something like 'onRemove'. I overwritten the addAsset function from asset manager ->AssetsView to display a new icon and add a new event, but the new event doesn't trigger. I read other issues and i seen that i could overwrite open-assets, but don't reall...

artf

Use Assets API

lock[bot]

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.