Remove(Element: Integer; WithChildrens: Boolean);
Element. Index of dictionary element.
WithChildrens. Element removing method. If parameter is set to true, the element is removed with child elements.
The Remove method removes specified element from dictionary.
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;
// Remove selected element
Dim.Remove(Element, False);
End Sub Button1OnClick;
On clicking the Button1 button dictionary element selected by user will be removed.
See also: