GrapesJS Issues

Search parsed GitHub issues, see highlighted answers, and open the original discussion when needed.

3464 issues found

#1553October 31, 2018by nine-2-five3 answers
0 reactions

Use jQuery in view update

I need to manipulate DOM with jQuery, when my model changes, but it seems the View is unaware of it.

yomeshgupta

Yes, $ is available would be available under editor.$ However, I am not sure if that would be full fledged jQuery. You can always insert custom JS scripts in the canvas during initialisation. If you want, you can add jQuery there and then...

artf

@isvaljek use this.$el instead of this.el

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.

#1550October 30, 2018by froderf2 answers
0 reactions

Remove Duplicate Css Rule by Class

Hi @artf , I'm reading and experimenting the setStyle method but when i used setStyle editor.getSelectedToStyle().setStyle({ color: 'red' }) it duplicates the css rule of that class e.g What I want is either removed the existing class or update that existing class css rule This issue is very similar to issue 932. I ne...

froderf

If there's no work around for this issue. what I need right now is used cssComposer.getClassRule() but the problem is, it is selecting the first class and not this updated class

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.

#1549October 29, 2018by jotakar2 answers
0 reactions

Question: getAll and getAllVisible

I read that getAll returns all assets collection and getAllVisible returns all assetes rendered in html (I understand:used in the template). But when I do execute editor.AssetManager.getAll().models and AssetManager.getAllVisible().models I get the same array: all assets in template used and not used. Why? Thanks

artf

It's not "the same array", you just get all the assets visible by default, so if do editor.AssetManager.render(['img1.jpg', 'img2.jpg']) you'll see the difference

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.

#1548October 29, 2018by jotakar3 answers
0 reactions

QUESTION: How insert box, section, footer, header...

I'm trying to imagine how to insert a header or a section or a box... I see the blocks panel, and extra an every panel, but all I can insert are rows - columns, images, navs... but a section or a box .... how do it? Please an answer :( Thanks

cjpollard

You can easily create your own blocks. https://grapesjs.com/docs/modules/Blocks.html

jotakar

Thanks Yes I know I can create blocks, but In the demo (https://grapesjs.com/demo.html) I see this elements but I can't see any special block for this kind of elements. This is the reason of my question, hoe this blocks have seen created i...

artf

@jotakar it's just an import of a pre-made template https://github.com/artf/grapesjs/blob/gh-pages/demo.html#L147

#1547October 29, 2018by ploutos272 answers
0 reactions

How to add component attributes (before rendering)

Hello, I'm looking to auto create components inside a block element and it seems that I manage to do that but with a small missing... How I can pass component attributes for each one ?? The code is below and it's create multiple blocks. Each block has different type of component. By passing the blcoks Array inside the...

artf

By what I see, from how you create blocks, it has nothing to do with the rendering of components, eg. parameters="null" is null because arrBlocks[j].value.parameters is null, that's all

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.

#1546October 29, 2018by jotakar1 answer
0 reactions

Bug: uploaded image appears as binary data,

I see that uploaded images appear in web page as binary (<img src="data:.....) not as image whith url (<img src="url"). is it posible to get that image uploaded appears as img src="./img/nameuploaded.jpg? Thanks

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.

#1545October 28, 2018by crashangelbr2 answers
2 reactions

[Question] How I Get ID From Block?

Hi, i have my block and I get print in Div id results from my javascript class component... How i get ID from my block ??? editor.BlockManager.add('test-block', { label: 'Test block', attributes: {class: 'fa fa-text'}, content: { content:'<div id=""></div>', script: function () { console.log(document.getElementById("M...

juanj

You can use this inside the script to reference the block element. If you want the id you can use this.id. Note that document.getElementById(this.id) == 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.

#1543October 26, 2018by TommyLjung2 answers
0 reactions

[Question] Enable Traist-checkbox by default

Hi. I am new to GrapesJs and really liking it so far. But now I have a (probably beginner) question: How can I make a trait-checkbox be selected by default? I have tried with: traits: [ { type: 'checkbox', label: 'Loop', name: 'model-loop-bool', changeProp: 1, selected: 'true', }], But "selected" or "checked" is not t...

artf

If you use changeProp you get the value from the component value, eg: without changeProp, it would be:

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.

#1541October 25, 2018by YashPrince2 answers
0 reactions

Remove Last changes From Undo Manager Stack

@artf Hello Can we remove the last event (changes) from undomanger. I need remove last event (change) from undo manger stack. I can get undo manager stack but could not modify it. Is there any way to set pointer of stack one or two step back or remove the last events from the stacks. There is a way like um.stop() and...

artf

The only way to move the pointer is to use undo/redo methods, so if you need to remove X steps you have to execute undo X times

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.

#1540October 24, 2018by SeongwoonHong2 answers
0 reactions

[Question] Is it possible to add event for preview?

I'd like to convert some texts when a user clicks the preview button. for instance, ((name)) (in the editor) should be 'David' (in preview mode) which comes from the server as it is dynamic field. So, would it be possible to call api when clicking preview and the preview result should wait till i get the data from the...

artf

You can use command events, eg:

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.