component:remove action
Question
Going through the available events, I'm curious as to why there is no "component:remove" action?
I've taken the approach of triggering the action by modifying the tlb-delete action. I would assume there's a better way, I'm just not sure what that would be quite yet.
defaultCommands['tlb-delete'] = {
run: function run(ed) {
var sel = ed.getSelected();
if (!sel || !sel.get('removable')) {
console.warn('The element is not removable');
return;
}
ed.select(null);
sel.destroy();
em && em.trigger('component:remove', null);
}
};
Answers (3)
Added for the next release
I would also be interested in having a component:remove event 👍
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 #710
Make an entire element draggable, not just the handle
I'm working on modifying the handle from draggable elements, in addition to having a handle, I'd like the entire element to be draggable. L...
Issue #1481
Component.remove() gets called on drag and on trash
There is no way currently to distinguish between remove() called on component when you are dragging it. And when you pres the trash button....
Issue #1191
Is there a way to find the number of components
I want to remove the component start from the second,so i need to take the traversal. domc.getComponents() is getting everything.i just wan...
Issue #1324
Remove attributes from a component
Hi @artf I don't know if it is possible to remove an attribute from a component. In our project I'm injecting a custom attribute from a cus...
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.