#2409November 14, 2019by promodnl1 answer
Hi...Can anyone please help me with the table widget.How can I have a popUp on the drag and drop of the widget.....which will accept the no. of rows and columns.Then get that no of rows and columns for that table in the editor. It would be a great help. Thanks in advance!!!
artf
Try to read the Getting Started guide, it more or less recaps your request. The only thing that is up to you is what to show in the Modal (eg. inputs UI)
#2408November 13, 2019by kickbk3 answers
I am listening for a component delete and move with removed() and sorter:drag:end. One last way (I hope) that I see the component move is by undo-ing a move. I need to listen to that event. Is there an event listener for undo?
artf
We actually support undo/redo events
artf
I think, currently, the only possible way to track those changes is by using component:update:components event which will pass the added/removed component
pouyamiralayi
@kickbk to my knowledge there is no such event, but i guess you can catch it by listening to `component:add` event. cheers!
#2406November 13, 2019by promodnl2 answers
Hello, ##Can anyone help me with the href property for any widget??I want to have the href property for a widget. So how can i add it.
pouyamiralayi
Hi @promodnl you must define a trait for your component.
promodnl
Hi @pouyamiralayi thank you for your response......
#2405November 13, 2019by fmr4113 answers
why when i change the ckeditor trait text it is not initialized my trait <pre> domComps.addType('text',{ model: dModel.extend({ defaults: Object.assign({}, dModel.prototype.defaults, { traits: [ {label:"Font Size", type:"text_fontsize"} ], }), }, { isComponent: function(el) { if (el.getAttribute && "text" == el.getAtt...
artf
As you're still using the old API definition (which is quite an error-prone) I recommend reading first the documentation about Component then probably you'll find the issue
fmr411
or is there another way to add trait (for text) so that ckeditor can work
artf
In the documentation you can see how to extend other components
#2404November 13, 2019by scott-coates3 answers
Is there an easy way to subscribe/listen to changes in the components/children of my custom component type? Perhaps an event I can subscribe to? Something like change:content? I want to add traits to children of my container component. If the children leave the container, the traits should disappear. I can think of 1...
pouyamiralayi
Is there an easy way to subscribe/listen to changes in the components/children of my custom component type? @scottccoates you can subscribe this way: cheers!
scott-coates
@pouyamiralayi thanks. I need to watch for children leaving/entering my component. I'm not sure what you supplied will help or am I missing something?
pouyamiralayi
@scottccoates this might help: cheers!
#2403November 12, 2019by varadero3 answers
How to reproduce:Naviagate to https://grapesjs.com/demo.htmlOpen browser console (Chrome) and type the following: setInterval(() => editor.load(), 1000) and press EnterGo to "Memory" tab (Chrome) and look at the memory usage What happens: The memory is constantly increasing. If you open Chrome's "Performance monitor"...
varadero
This is important. If not fixed, it makes GrapesJS dangerous to use especially in SPA applications.
artf
I'll check it out, but any help is welcome
diazemiliano
I'm having the same issue here. Even after destroy the editor, the issue remains.
#2402November 12, 2019by varaderoNo answers
I am using editor.load with the built in local storage manager and the result is that styling for elements is lost. How to reproduce:Navigate to https://grapesjs.com/demo.html (or use new grapesjs project and initialize it with storageManager: { type: 'local' } and plugins: ['gjs-blocks-basic'])Go to "Blocks" and drag...
#2401November 12, 2019by Indhumathi20162 answers
I have been trying to enable a checkbox in trait on load, when a element is present in canvas but unfortunately i don't know how to check the element is present or not, i'm trying the following code in onRender() method const canvasElement = editor.DomComponents.getWrapper(); let isGdprEnabled = false; if (canvasEleme...
pouyamiralayi
Hi @Indhumathi2016 you can use find method: cheers!
Indhumathi2016
@pouyamiralayi It's working fine when i do like this editor.on('load', () => { const wrapper = editor.getWrapper() const el = wrapper.find('#gist-gdpr')[0] }); Thanks
#2400November 12, 2019by ned-kelly2 answers
Hi Guys, Firstly awesome project, have really enjoyed extending GJS to work with our use case - and am excited for what's in store looking at some of the issues/features in-progress... So, I'm using GJS to with custom buttons added into the Panel via addButton (like so): Now all works as expected when you toggle/untog...
pouyamiralayi
Hi @ned-kelly try this: cheers!
ned-kelly
@pouyamiralayi, you're amazing - sorry for asking what's seemingly a simple question - couldn't find any previous GitHub issues or comments about this in the documentation!
#2399November 12, 2019by imranali20453 answers
Hi, I am using grapesjs in angular 7.What I want to achieve when ever canvas drop method called I add svg component in canvas.I have add svg component on canvas drop method.But its not draggable. I attach my code and video for better understand.Thanks @artf if you help me. <code>const domComponents = this._editor.DomC...
imranali2045
@artf please see that It is very important for me to solve this problem.thanks
artf
Unfortunately, HTML5 drag and drop API doesn’t work on SVG elements, so if you need to support it you have to wrap your SVG components (eg. in a div element)
imranali2045
@artf ok thanks