Issue #1889Opened March 13, 2019by Nagavijay-kolla0 reactions

How to append a child component at required position/index

Question

For example, I have a parent component and this parent component has 4 child components. Here with trait functionality, I want to move the 3rd child component to 1st position likewise.

I am able to move a component from any position to last by removing it from the existing position using component.remove() and adding it to parent using component.append(ref of removecomponent) . So it is moving to last.

Now I want to move a child component from one place to another place on trait value change

Can you give me any idea?

Thanks in Advance.

Answers (2)

artfMarch 22, 20190 reactions

Use at, as an index, in options, eg. component.append(comp, { at: 0 }) will place the comp as a first element

lock[bot]March 21, 20200 reactions

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.

Paid Plugins That Match This Issue

Curated by issue keywords and label relevance to help you ship faster.

View all plugins

Loading paid plugin recommendations...

Browse Plugin Categories

Jump directly to plugin category pages on the marketplace.