React FileManager API

The FileManager is a UI component that allows users to upload, select, and manage files and directories in different file storages.

import FileManager from "devextreme-react/file-manager"
Selector: FileManager

Configuration

This section describes properties that configure the FileManager UI component's contents, behavior, and appearance.

Name Description
accessKey

Specifies the shortcut key that sets focus on the UI component.

activeStateEnabled

Specifies whether the UI component changes its visual state as a result of user interaction.

allowedFileExtensions

Specifies the allowed upload file extensions.

contextMenu

Configures the context menu settings.

currentPath

Specifies the path that is used when the FileManager is initialized.

currentPathKeys

Specifies an array of path keys to the current location.

customizeDetailColumns

Customizes columns in details view. Applies only if itemView.mode is "details".

customizeThumbnail

Allows you to provide custom icons to be used as thumbnails.

disabled

Specifies whether the UI component responds to user interaction.

elementAttr

Specifies the global attributes to be attached to the UI component's container element.

fileSystemProvider

Specifies the file system provider.

focusedItemKey

Specifies a key of the initially or currently focused item.

focusStateEnabled

Specifies whether the UI component can be focused using keyboard navigation.

height

Specifies the UI component's height.

hint

Specifies text for a hint that appears when a user pauses on the UI component.

hoverStateEnabled

Specifies whether the UI component changes its state when a user pauses on it.

itemView

Configures the file and directory view.

notifications

Configures notification settings.

onContentReady

A function that is executed when the UI component is rendered and each time the component is repainted.

onContextMenuItemClick

A function that is executed when a context menu item is clicked.

onContextMenuShowing

A function that is executed before a context menu is displayed.

onCurrentDirectoryChanged

A function that is executed when the current directory is changed.

onDirectoryCreated

A function that is executed when a directory is created.

onDirectoryCreating

A function that is executed before a directory is created.

onDisposing

A function that is executed before the UI component is disposed of.

onErrorOccurred

A function that is executed when an error occurs.

onFileUploaded

A function that is executed when a file is successfully uploaded.

onFileUploading

A function that is executed before the file is uploaded.

onFocusedItemChanged

A function that is executed when the focused item is changed.

onInitialized

A function used in JavaScript frameworks to save the UI component instance.

onItemCopied

A function that is executed when a file or directory is copied.

onItemCopying

A function that is executed before a file or directory is copied.

onItemDeleted

A function that is executed when a file or directory is deleted.

onItemDeleting

A function that is executed before a file or directory is deleted.

onItemDownloading

A function that is executed before a file is downloaded.

onItemMoved

A function that is executed when a file or directory is moved.

onItemMoving

A function that is executed before a file or directory is moved.

onItemRenamed

A function that is executed when a file or directory is renamed.

onItemRenaming

A function that is executed before a file or directory is renamed.

onOptionChanged

A function that is executed after a UI component property is changed.

onSelectedFileOpened

A function that is executed when the selected file is opened.

onSelectionChanged

A function that is executed when a file system item is selected or selection is canceled.

onToolbarItemClick

A function that is executed when a toolbar item is clicked.

permissions

Specifies actions that a user is allowed to perform on files and directories.

rootFolderName

Specifies the root directory display name.

rtlEnabled

Switches the UI component to a right-to-left representation.

selectedItemKeys

Contains an array of initially or currently selected files and directories' keys.

selectionMode

Specifies whether a user can select a single or multiple files and directories in the item view simultaneously.

tabIndex

Specifies the number of the element when the Tab key is used for navigating.

toolbar

Configures toolbar settings.

upload

Configures upload settings.

visible

Specifies whether the UI component is visible.

width

Specifies the UI component's width.

Methods

This section describes methods that control the FileManager UI component.

Name Description
beginUpdate()

Postpones rendering that can negatively affect performance until the endUpdate() method is called.

defaultOptions(rule)

Specifies the device-dependent default configuration properties for this component.

dispose()

Disposes of all the resources allocated to the FileManager instance.

element()

Gets the root UI component element.

endUpdate()

Refreshes the UI component after a call of the beginUpdate() method.

focus()

Sets focus on the UI component.

getCurrentDirectory()

Gets the current directory object.

getInstance(element)

Gets the instance of a UI component found using its DOM node.

getSelectedItems()

Gets the selected items.

instance()

Gets the UI component's instance. Use it to access other methods of the UI component.

off(eventName)

Detaches all event handlers from a single event.

off(eventName, eventHandler)

Detaches a particular event handler from a single event.

on(eventName, eventHandler)

Subscribes to an event.

on(events)

Subscribes to events.

option()

Gets all UI component properties.

option(optionName)

Gets the value of a single property.

option(optionName, optionValue)

Updates the value of a single property.

option(options)

Updates the values of several properties.

refresh()

Reloads data and repaints the UI component.

registerKeyHandler(key, handler)

Registers a handler to be executed when a user presses a specific key.

repaint()

Repaints the UI component without reloading data. Call it to update the UI component's markup.

resetOption(optionName)

Resets a property to its default value.

Events

This section describes events that the FileManager UI component raises.

Name Description
contentReady

Raised when the UI component's content is ready.

contextMenuItemClick

Raised when a context menu item is clicked.

contextMenuShowing

Raised before the context menu is displayed.

currentDirectoryChanged

Raised when the current directory is changed.

directoryCreated

Raised when a directory is created.

directoryCreating

Raised before a directory is created.

disposing

Raised before the UI component is disposed of.

errorOccurred

Raised when an error occurs during file processing.

fileUploaded

Raised when a file is uploaded.

fileUploading

Raised before a file is uploaded.

focusedItemChanged

Raised when the focused item is changed.

initialized

Raised only once, after the UI component is initialized.

itemCopied

Raised when a file or directory is copied.

itemCopying

Raised before a file or directory is copied.

itemDeleted

Raised when a file or directory is deleted.

itemDeleting

Raised before a file or directory is deleted.

itemDownloading

Raised before a file is downloaded.

itemMoved

Raised when a file or directory is moved.

itemMoving

Raised before a file or directory is moved.

itemRenamed

Raised when a file or directory is renamed.

itemRenaming

Raised before a file or directory is renamed.

optionChanged

Raised after a UI component property is changed.

selectedFileOpened

Raised when the selected file is opened.

selectionChanged

Raised when a file system item is selected or selection is canceled.

toolbarItemClick

Raised when a toolbar item is clicked.

See Also

File System Providers

File system providers are components that provide APIs used to access and modify virtual file systems. This section describes file system providers supported by the FileManager.

Interfaces

This section describes interfaces that the FileManager component uses.