how to drag parent component from selectable child
Question
i have a component type "table" and i find move this table draging her inner components (selectables/stylables) (th, td, ...) this is posible? thanks a lots
Answers (2)
thanks man, but, i was looking for something like this (just for absolute mode)
`
editor.on("run:tlb-move:before", (targetCollection) => {
// Obtengo referencias al componente seleccionado
var target = targetCollection.target;
var el = target.view.el;
//Verifico si tengo un componente padre que me interese
var component = !!el.closest("table") ? "table" : !!el.closest("form") ? !!el.closest("form").attributes["data-ic-profiling-form"] ? "profiling-form" : "form" : null;
//Si tengo padre y el hijo no es arrastrable
if (component && !target.get("draggable")) {
//functión para recorrer los componentes padres
var findParentContainerComponent = parent => {
//Si estoy parado en el padre actualizo el drag-target
if (parent.get("type") === component) {
//Actualizo el target y detengo el bucle
targetCollection.target = parent;
return ;
}
//Busco al padre del elemento actual
findParentContainerComponent(parent.parent());
};
//Busco y selecciono el componente padre que me interesa
findParentContainerComponent(target);
}
});
`@alemenciones Select parent using the arrow icon:

then drag parent like below:

Cheers!
Related Questions and Answers
Continue research with similar issue discussions.
Issue #1889
How to append a child component at required position/index
For example, I have a parent component and this parent component has 4 child components. Here with trait functionality, I want to move the...
Issue #2195
[Question] Define components in template
QuestionsHow can I make a part of my template a component ?How can I set draggableComponents on such a component?If so, then can I stop set...
Issue #2472
DragData extend for other components like div etc
Hi @artf How to implement dragData event for custom components(external).I called dragData method on div drag but dataTransfer and content...
Issue #1709
[QUESTION] Is it possible to affect child component's styling through parent component's style manager?
Hello there! Awesome project and thanks for your contribution. I would like to know if it is possible to change the styling of a child comp...
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.