removeArrayItem method

void removeArrayItem(
  1. Array arr, [
  2. num? idx
])

Remove an item from a data array that may be data bound by a Panel as its Panel#itemArray, given the index at which to remove a data value, in a manner that can be undone/redone and that automatically updates any bindings.

This also calls #raiseChangedEvent to notify all listeners about the ChangedEvent.Remove.

If you want to remove a node from the diagram, call #removeNodeData.

Note that there is no version of this method that takes an item value instead of an index into the array. Because item arrays may hold any JavaScript value, including numbers and strings, there may be duplicate entries with that value in the array. To avoid ambiguity, removing an item from an array requires an index. @param {Array.<*>} arr an Array that is the value of some Panel's Panel#itemArray. @param {number=} idx the zero-based array index of the data item to be removed from the array; if not supplied it will remove the last item of the array. @see #insertArrayItem

Implementation

void removeArrayItem(
  _i7.Array<_i2.dynamic> arr, [
  _i2.num? idx,
]) {
  _i4.callMethod(
    this,
    'removeArrayItem',
    [
      arr,
      idx ?? _i5.undefined,
    ],
  );
}