Skip to main content

Location Tree

Overview

The Location Tree component is a custom Perspective component that provides a hierarchical tree view of locations. It allows users to easily navigate and select locations from a structured list.

Props

The Location Tree component has the following props:

Prop NameTypeDescriptionInput/Output
showSearchbooleanIf true, shows a search box at the top of the tree to filter locations.Input
selectedItemobjectThe currently selected item in the tree. Contains the properties id (string), notes (string), storageCapacityUnitId (string), description (string), storageCapacity (number), lotStorageStrategy (string), type (string), parentId (string), enabled (boolean), path (string), allowNegativeInventory (boolean), sortOrder (number), name (string), processType (string), lotUseStrategy (string), spare1 (string), spare2 (string), spare3 (string)Output
currentItemIdstringThe ID of the item most recently clicked on. This is useful for tracking user interaction with the tree.Output
forceRefreshbooleanIf true, forces the tree to refresh its data from the server. Automatically resets to false after 500ms.Input
allowEditbooleanIf true, allows the user to edit the tree (add, edit, delete, cut, paste, etc.).Input
rootPathstringIf set, only shows locations that are descendants of the specified location path.Input
hideItemsarray[string]An array of location IDs to hide from the tree. Also hides their children.Input
showImportbooleanIf true, shows an "Import" button to allow importing locations from a CSV or JSON file.Input
showExportbooleanIf true, shows an "Export" button in the context menu to allow exporting locations to a CSV or JSON file.Input
importTooltipstringThe tooltip text to show when hovering over the "Import" button.Input

Events

The Location Tree component emits the following events:

Event NameDescriptionPayload
onAddEmitted when the user adds a new location.{ currentItemId: string }
onDeleteEmitted when the user deletes a location.{ currentItemId: string }
onImportEmitted when the user imports locations.None
onExportEmitted when the user exports locations.{ currentItemId: string}