IDynamicInstance.RearrangeChildren

Syntax

RearrangeChildren(Parent: Integer; Childs: Array): Boolean;

Parameters

Parent. Index of parent element;

Childs. Array of child elements.

Description

The RearrangeChildren method arranges elements belonging to specified parent element and located on the same level.

Example

Executing the example requires a form containing the DimensionTree component with the DimensionTree1 identifier, the UiDimension component with the UiDimension1 identifier and the Button component with the Button1 identifier. Determine the UiDimension1 component as data source for the DimensionTree1 component. Data source for the UiDimension1 component must be MDM table dictionary with set dynamic loading of elements.

The example is a handler of the OnClick event for the Button1 component.

Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var
    Dim: IDynamicInstance;
    Element: Integer;
Begin
    Dim := UiDimension1.DimInstance As IDynamicInstance;
    Element := DimensionTree1.FocusedElement;
    If Dim.HasLoadedChildren(Element) Then
        Dim.RearrangeChildren(Element, Dim.LoadedChildren(Element));
        Else
            Dim.RearrangeChildren(Element, Dim.UnloadedChildren(Element));
    End If;
End Sub Button1OnClick;

On clicking the Button1 button child elements of the parent element selected by user will be sorted.

See also:

IDynamicInstance