Hi artf, i have a question when i implement grid component having row and three cells , i want to make these cells resiazable on width and height , So i make an event when component selected set it resizable =true , when resize cells height it works , but the cells width not affect yet when resize it , how i can make...
artf
This is because the grid uses flex so you should use flex-basis for the width. In that case resizable should be an object like this { keyWidth: 'flex-basis' }
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.
when i add block(tag i), data-gjs type is "I" (there is no problem from the trait that I made) i'm have trait but if save and reload, data-gjs type to be "default" (trait doesn't work) Thank's
artf
You store/load incorrectly, read here please https://grapesjs.com/docs/modules/Storage.html#store-and-load-templates
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.
Hi, I want to add the new field in default input traits. for example:- i need to add {label: binding, name:binding} in already exist input traits in the above image. i need to add the new field in between of name and placeholder. can anyone please help me Thanks in Advance
arthuralmeidap
In the docs, there is exactly an explanation about what you are looking for. Take a look here: https://grapesjs.com/docs/modules/Traits.html#add-traits-to-components
Ramkumar-Murugesan
I did this by using and its working fine
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.
Hi, I just had a quick question because I could not figure out how to do it or did not find an issue related to it. I am just trying to call a function when any changes is done on the canvas. For example, I am adding a block or removing a block. I am changing the attributes using the style manager. Or drag and droppin...
a-bashtannik
@simplecommerce , try also this, maybe fit better for you
arthuralmeidap
The way you did is the simplest way to achieve that in my opinion.
arthuralmeidap
What do you want to achieve at the end? You could use something like editor.on('all', () => //your code here ); but this is not practical at all. there are many events being triggered by GrapesJS and I don't think this will suit your needs.
I have a problem in getHtml. I add an icon in the button, in the web the icon is visible, and when in the inspect element there is an icon object, but when in getHtml it uses the editor.getHtml() function, the icon disappears. Object icon result editor.getHtml() :
artf
getHtml is based on the component model data, you probably just changing its view data (eg. this.$el.append('<i class="fa ...')). Read carefully this part https://grapesjs.com/docs/modules/Components.html
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.
Hello @artf , Hope you are doing fine. I was trying to show all the blocks under different tabs. For example: displaying sections, columns under Basic tab and other items under another tab named Elements. I have gone through the issue: https://github.com/artf/grapesjs/issues/499 but didn't find any final solution or d...
artf
Hi @sunhillbd I don't know exactly what is not clear in that issue but I think all you have to know is here. With the BlockManager.render method you can control block listing, which logic/UI you'll use (select input, tabs, search, etc.) it...
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.
Hi @artf , When I drag the section block, a plus button is displaying. After save and reloading the page, "+" button not showing. I need to show the button after page reload also. Please suggest me, how can I solve this problem? Please check the jsfiddle, similar scenario created.
noogen
@sanjib00 when you render fromElement, it's a content, not component. e.g. "\<section\>" html tag would not automatically get recognize as component because you don't have any code to recognize it as so. (hint: isComponent function or data...
artf
@sanjib00 probably you're loading incorrectly your template data https://grapesjs.com/docs/modules/Storage.html#store-and-load-templates
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.
I have tried this solution https://github.com/artf/grapesjs/issues/1819#event-2158016066 But on custom components Let's say, i have a mixture to two text input and a button, How do it specify attributes ngModel to both two text input?
artf
Create a custom abstract component with ngModel and then just use it when you need it
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.
I have two questions.Is there any way to change the built-in components name? I wanted to change the name "Box" to "Div". so the same name appears on select and on the layers/navigator panel. In simple term, if I drag and dropped a div, I need it to be named Div.Any way to add an icon in front of the text of each item...
NicoEngler
You can use data-gjs-custom-name on your components html. <h1 data-gjs-custom-name="Your Name" ...>You can use data-gjs-icon on your components html. <h1 data-gjs-icon='<i class="fa fa-arrows"></i>' ...> Please change your title to somethi...
artf
I'd add that if you rely on HTML5 drag & drop, you can use canvas:dragdata event https://grapesjs.com/docs/api/editor.html#available-events This allows you to make the editor understand "external drops", eg. by default GrapesJS can recogni...
minuwan
@NicoEngler Any other way to set default custom names for each type? If someone drag and drop content from outside, I want to display those div's names as "Divs" as well. :)
I'd like to do something like this. so once a user drops the test component into the canvas, I'd like to open up asset manager modal where you can upload an image by running 'open-assets' command. Thank you very much Artur
NicoEngler
To achieve this, you can listen to the drag event of the editor:
SeongwoonHong
@NicoEngler Thank you for reply! although, I'm not sure how to insert an image from image modal into the link-block component if i do this, nothing happens even after i select an image from the modal @artf Is there any way to do that? Plus...
NicoEngler
I´m afraid I can't assist further without playing around with the code myself. Though I can help debugging if you shoot up an example on codepen or similar.