[BUG] render does not respond
Question
When using the code:
pan = panelManager.getPanel('myNewPanel');
pan.buttons = []
editor.render()
I would expect the panel to appear without any buttons. It does not appear to do so...
[update] I switched to:
pan = pnm.getPanel('myNewPanel');
var i;
for (i=0; i<pan.buttons.models.length; ++i) {
pnm.removeButton('myNewPanel', pan.buttons.models[i].id)
}
Which when used on 3 buttons, deleted the first and the last, but not the second.
[update 2] I have finally added the next functions, as a temp workaround until bug is resolved..
function sleep(ms) {
return new Promise(resolve => setTimeout(resolve, ms));
}
async function removeBtn(buttonName) {
await sleep(500);
pnm.removeButton('myNewPanel', buttonName)
}
What I am trying to do is build a DOM parent tree of the selected component. So that every time I click on a component I have a bottom panel that has a list of buttons representing the parents of the component.
Answers (2)
editor.Panels.getPanel('options').get('buttons').reset()
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.
Related Questions and Answers
Continue research with similar issue discussions.
Issue #542
Calling render() on PanelManager breaks style manager
In lieu of #540, I'm trying to manually remove a button from the options panel, with this: This works ok, the button goes away, but the pnm...
Issue #908
[FEATURE REQUEST] Add custom classes to panels and other editor elements
When using a UI framework that provides custom classes, it would be nice to be able to use these classes on things like panels, so you woul...
Issue #1227
Re-render view in editor's canvas whenever Trait value changes
Is there any possible way in grapesjs that whenever a user changes the value of a Trait of a custom component the render function should li...
Issue #1579
Border Color Issue
@artf There is bug in the border color if you drag a button on the editor and paste color like rgb(255, 0, 0) in border color and select an...
Paid Plugins That Match This Issue
Curated by issue keywords and label relevance to help you ship faster.
Loading paid plugin recommendations...
Browse Plugin Categories
Jump directly to plugin category pages on the marketplace.