#852February 9, 2018by JulyanoF2 answers
I'm re-declaring a link type like this: When my button (<a>) is created, it is creating like this: <a class="btn botao-roxo">Botão</a> I would like to know how can I change the content of this (Botão) in traits.
JulyanoF
Exactly what I was looking for: Define new Trait type
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.
#851February 8, 2018by maxtacco3 answers
Hi @artf, I have a case where a custom plugin needs to check user permissions before doing any kind of initialization. The method that does the check returns a Promise, so I have to wait for it to resolve before doing anything. Unfortunately, this creates a raise condition with editor rendering and UI gets into some w...
nashton109
I had a similar requirement. If it helps others, my solution in the end was to create a plugin which then loads my other plugins; The editor config would just reference the one plugin and the plugin options for that plugin would contain th...
maxtacco
Also, this may require GrapesJS' init method to return a Promise instead of the editor, but this can be limited only to cases when there are any plugins that return Promises.
artf
I have to set 'editor.autorender' to false and then render editor manually once my plugin is initialized. This is fine for now, but I'm not quite sure how I would handle this case if I had multiple custom plugins depending on some async lo...
#850February 8, 2018by austinbiggs3 answers
What I'm trying to accomplish: I have a piece of code I need to run when a component is "dropped". I put "dropped" in quotes, because it needs to fire when the tlb-move ends. So as a user, if I click the Move icon in the toolbar, when I finishing moving the component I need my code to fire. I've tried quite a few even...
artf
Have you tried with Components-&-JS?
maxtacco
Having the same problem - I can't figure out an event on a component to listen for when move ends.
maxtacco
So, the only way I was able to make it reasonably work was to listen for the "selectedComponent" event that is fired in https://github.com/artf/grapesjs/blob/b62e032b06f45382849b59e6a3f32049f0a021fc/src/commands/index.js#L168 in my compone...
#849February 8, 2018by ajwootto3 answers
In my use case, I'm trying to change the store and load URLs used by the remote storage manager dynamically. As far as I can tell, the editor does not pick up and use any changes to the config if I change them directly, ie. after the editor has already been initialized. To try and get around it, I was attempting to un...
maxtacco
You can access RemoteStorage and update urls at any time:
arthuralmeidap
@ajwootto , You can create a custom Remote Storage and inside it apply your custom saving/updating logic. Take a look on this link: https://github.com/artf/grapesjs/wiki/API-Storage-Manager
ajwootto
Both of those options would probably work, however something I forgot to mention is that in some cases, I want to re-initialize the editor with components and styles pre-specified (ie. passing them in the init) rather than loading them fro...
#847February 8, 2018by ghost2 answers
how to get (grapesjs-preset-webpage.min.js file ) as (grapesjs-preset-webpage.js) file to understand editor options. thanks for this great work and help.
arthuralmeidap
go to the grapesjs-preset-webpage repo on github and check the source code. There you can take a look over all the code and check what you need. Repo: https://github.com/artf/grapesjs-preset-webpage
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.
#846February 7, 2018by davidherlopgt3 answers
Hi guys I'm starting to use Grapesjs and I have a problem, I am trying to add 3 new commands to create tables, add rows and cells, the table works fine but when I add a row into the table I get this error: "Invalid target position: Target collection not found, Target is not droppable, accepts [undefined], Component no...
davidherlopgt
I forget put what version I am using grapesjs - 0.13.5 <link rel="stylesheet" href="Config/grapesjs-dev/dist/css/grapes.min.css"> <link rel="stylesheet" href="Config/grapesjs-preset-webpage-master/dist/grapesjs-preset-webpage.min.css"/> <s...
artf
@davidherlopgt Have you tried to use built-in table components instead of extending them? BTW create a live demo please
davidherlopgt
Hi artf thanks for your answer, I tried to use the table component and I can add the Table with one row and one cell in the header and the body, maybe the disadvantage is that if I change the color of the row to the header the body is chan...
#845February 7, 2018by chiqui3d3 answers
I've created a new type of component an general iframe, avoiding selecting the map, but when I try to select it in canvas so that the settigns appear it's impossible for me. This is the component code.
artf
Hey @chiqui3d try to copy the view logic from the ComponentMapView. Basically you're not able to select it because everything inside it is overlapping the iframe element itself (elements inside iframe are out of the editor's scope). As you...
chiqui3d
OK, but then I can never edit the previously created iframe src, or I can do is create a div envelope with editor on load in the view, for iframe elements not created from grapesjs, right? thanks @artf
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.
#844February 7, 2018by YeungLong1 answer
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...
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.
#843February 6, 2018by arthuralmeidap3 answers
hi @artf , I import a html , using import from grapesjs-preset-newsletter, with some css classes inside the <style> tag. After the import, when I call editor.getCss(), some classes that I added before are missing now. I checked that those css classes are not been used anywhere. QQ: The CssComposer module removes the u...
artf
QQ: The CssComposer module removes the unused css classes? Yeap
arthuralmeidap
Nice, 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.
#842February 6, 2018by Deepak8133 answers
Hi @artf, How we can set array values using editor.getSelected().set('attributes',array value); If we try to do so with the same code then it insert NaN to attributes.
arthuralmeidap
@Deepak813 , You should follow one of the following syntaxes:editor.getSelected().set({title: "March 20", content: "In his eyes she eclipses..."}); -> for multiple attributes. You send a objecteditor.getSelected().set("title", "March 20");...
artf
How we can set array values using editor.getSelected().set('attributes',array value); You can't set array on attributes property, it should be an object instead. I'd recommend using a more specific methods like model.setAttributes({ title:...
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.