JavaScript/jQuery FileManager Options
This section describes properties that configure the FileManager UI component's contents, behavior, and appearance.
accessKey
The value of this property will be passed to the accesskey
attribute of the HTML element that underlies the UI component.
activeStateEnabled
The UI component switches to the active state when users press down the primary mouse button. When this property is set to true, the CSS rules for the active state apply. You can change these rules to customize the component.
Use this property when you display the component on a platform whose guidelines include the active state change for UI components.
allowedFileExtensions
The FileManager UI component cannot upload a file and displays an error message when the file's extension is not allowed.
customizeDetailColumns
Customizes columns in details view. Applies only if itemView.mode is "details".
customizeThumbnail
This function should return one of the following:
- The icon's URL
- The icon's name if the icon is from the DevExtreme icon library
- The icon's CSS class if the icon is from an external icon library (see External Icon Libraries)
- The icon in the Base64 format
elementAttr
Specifies the global attributes to be attached to the UI component's container element.
fileSystemProvider
File system providers are components that provide APIs used to access and modify virtual file systems.
Refer to File System Providers for information on supported file system providers.
The following example illustrates how to configure an Object file system provider:
height
This property accepts a value of one of the following types:
Number
The height in pixels.String
A CSS-accepted measurement of height. For example,"55px"
,"20vh"
,"80%"
,"inherit"
.Function (deprecated since v21.2)
Refer to the W0017 warning description for information on how you can migrate to viewport units.
onContentReady
A function that is executed when the UI component is rendered and each time the component is repainted.
Name | Type | Description |
---|---|---|
element |
The UI component's container. It is an HTML Element or a jQuery Element when you use jQuery. |
|
component |
The UI component's instance. |
onContextMenuItemClick
Name | Type | Description |
---|---|---|
component |
The UI component's instance. |
|
element |
The UI component's container. It is an HTML Element or a jQuery Element when you use jQuery. |
|
event | Event (jQuery or EventObject) |
The event that caused the function to execute. It is an EventObject or a jQuery.Event when you use jQuery. |
fileSystemItem |
The file system item for which you invoke the context menu. |
|
itemData |
The clicked item's data. |
|
itemElement |
The item's container. It is an HTML Element or a jQuery Element when you use jQuery. |
|
itemIndex |
The clicked item's index. |
|
viewArea |
Specifies whether the context menu is invoked in the navigation panel or in the items area. |
onContextMenuShowing
Name | Type | Description |
---|---|---|
cancel |
Allows you to cancel showing the context menu. |
|
component |
The UI component's instance. |
|
element |
The UI component's container. It is an HTML Element or a jQuery Element when you use jQuery. |
|
event | Event (jQuery or EventObject) |
The event that caused the function to execute. It is an EventObject or a jQuery.Event when you use jQuery. |
fileSystemItem |
The file system item for which you invoke the context menu. |
|
targetElement |
The file system item's container. It is an HTML Element or a jQuery Element when you use jQuery. This element can be a grid element or a thumbnail (for the items view area), or a tree view node (for the navigation panel). The targetElement field value is 'undefined' if you click on empty space in the items view area. |
|
viewArea |
Specifies whether the context menu is invoked in the navigation panel or in the items view area. |
onCurrentDirectoryChanged
Name | Type | Description |
---|---|---|
component |
The UI component's instance. |
|
directory |
The current directory. |
|
element |
The UI component's container. It is an HTML Element or a jQuery Element when you use jQuery. |
onDirectoryCreated
Name | Type | Description |
---|---|---|
component |
The UI component's instance. |
|
element |
The component's container. It is an HTML Element or a jQuery Element when you use jQuery. |
|
name |
The name of the created directory. |
|
parentDirectory |
The parent directory. |
Use the Create Directory context menu or toolbar item to invoke the dialog. In the dialog, enter the directory name and click Create to create a new directory.
See Also
onDirectoryCreating
Name | Type | Description |
---|---|---|
cancel | | |
Allows you to cancel the directory creation. |
component |
The UI component's instance. |
|
element |
The component's container. It is an HTML Element or a jQuery Element when you use jQuery. |
|
errorCode |
The error code. The following error codes are supported:
|
|
errorText |
Allows you to specify the error message. |
|
name |
The name of the directory. |
|
parentDirectory |
The parent directory. |
Use the Create Directory context menu or toolbar item to invoke the dialog. In the dialog, enter the directory name and click Create to create a new directory.
The component executes the onDirectoryCreating function when a user enters a directory name and clicks Create in the dialog.
See Also
onDisposing
A function that is executed before the UI component is disposed of.
Name | Type | Description |
---|---|---|
element |
The UI component's container. It is an HTML Element or a jQuery Element when you use jQuery. |
|
component |
The UI component's instance. |
onErrorOccurred
Name | Type | Description |
---|---|---|
component |
The UI component's instance. |
|
element |
The UI component's container. It is an HTML Element or a jQuery Element when you use jQuery. |
|
errorCode |
The error code. The following error codes are supported:
|
|
errorText |
Allows you to specify the error message. |
|
fileSystemItem |
The processed file or directory. |
onFileUploaded
Name | Type | Description |
---|---|---|
component |
The UI component's instance. |
|
element |
The component's container. It is an HTML Element or a jQuery Element when you use jQuery. |
|
fileData |
The uploaded file. |
|
parentDirectory |
The parent directory. |
Use the Upload Files context menu or toolbar item to invoke the "Open" dialog and select a file to upload.
See Also
onFileUploading
Name | Type | Description |
---|---|---|
cancel | | |
Allows you to cancel the file upload. |
component |
The UI component's instance. |
|
destinationDirectory |
The directory where a file is uploaded to. |
|
element |
The component's container. It is an HTML Element or a jQuery Element when you use jQuery. |
|
errorCode |
The error code. The following error codes are supported:
|
|
errorText |
Allows you to specify the error message. |
|
fileData |
The file to be uploaded. |
Use the Upload Files context menu or toolbar item to invoke the "Open" dialog and select a file to upload.
The component executes the onFileUploading function when a user clicks Open in the dialog.
See Also
onFocusedItemChanged
Name | Type | Description |
---|---|---|
component |
The UI component's instance. |
|
element |
The UI component's container. It is an HTML Element or a jQuery Element when you use jQuery. |
|
item |
The currently focused file or directory. |
|
itemElement |
The item's container. It is an HTML Element or a jQuery Element when you use jQuery. |
onInitialized
Name | Type | Description |
---|---|---|
element |
The UI component's container. It is an HTML Element or a jQuery Element when you use jQuery. |
|
component |
The UI component's instance. |
onItemCopied
Name | Type | Description |
---|---|---|
component |
The UI component's instance. |
|
element |
The component's container. It is an HTML Element or a jQuery Element when you use jQuery. |
|
itemName |
The name of the copied file or directory. |
|
itemPath |
The path to the copied file or directory. |
|
parentDirectory |
The parent directory. |
|
sourceItem |
The copied file or directory. |
Select a file/folder and use the Copy To context menu or toolbar item to invoke the "Copy to" dialog. In the dialog, select the destination directory and click Copy.
See Also
onItemCopying
Name | Type | Description |
---|---|---|
cancel | | |
Allows you to cancel the file or directory copy process. |
component |
The UI component's instance. |
|
destinationDirectory |
The directory where the file or directory is being copied to. |
|
element |
The component's container. It is an HTML Element or a jQuery Element when you use jQuery. |
|
errorCode |
The error code. The following error codes are supported:
|
|
errorText |
Allows you to specify the error message. |
|
item |
The file or directory to be copied. |
Select a file/folder and use the Copy To context menu or toolbar item to invoke the "Copy to" dialog. In the dialog, select the destination directory and click Copy.
The component executes the onItemCopying function when a user clicks Copy in the dialog.
See Also
onItemDeleted
Name | Type | Description |
---|---|---|
component |
The UI component's instance. |
|
element |
The component's container. It is an HTML Element or a jQuery Element when you use jQuery. |
|
item |
The deleted file or directory. |
Select a file/folder and click the Delete context menu or toolbar item. In the confirmation dialog, click "Delete" to delete the file/folder.
See Also
onItemDeleting
Name | Type | Description |
---|---|---|
cancel | | |
Allows you to cancel the file or directory deletion. |
component |
The UI component's instance. |
|
element |
The component's container. It is an HTML Element or a jQuery Element when you use jQuery. |
|
errorCode |
The error code. The following error codes are supported:
|
|
errorText |
Allows you to specify the error message. |
|
item |
The file or directory to be deleted. |
Select a file/folder and click the Delete context menu or toolbar item. In the confirmation dialog, click "Delete" to delete the file/folder.
The onItemCopying function is executed when a user clicks Delete in the confirmation dialog.
See Also
onItemDownloading
Name | Type | Description |
---|---|---|
cancel | | |
Allows you to cancel the file download. |
component |
The UI component's instance. |
|
element |
The component's container. It is an HTML Element or a jQuery Element when you use jQuery. |
|
errorCode |
The error code. The following error codes are supported:
|
|
errorText |
Allows you to specify the error message. |
|
item |
The file to be downloaded. |
Select a file and use the Download context menu or toolbar item.
The component executes the onItemDownloading function when a user clicks Download in the dialog.
See Also
onItemMoved
Name | Type | Description |
---|---|---|
component |
The UI component's instance. |
|
element |
The component's container. It is an HTML Element or a jQuery Element when you use jQuery. |
|
itemName |
The name of the moved file or directory. |
|
itemPath |
The path to the moved file or directory. |
|
parentDirectory |
The parent directory. |
|
sourceItem |
The moved file or directory. |
Select a file/folder and use the Move To context menu or toolbar item to invoke the "Move to" dialog. In the dialog, select the destination directory and click Move.
See Also
onItemMoving
Name | Type | Description |
---|---|---|
cancel | | |
Allows you to cancel the file or directory move process. |
component |
The UI component's instance. |
|
destinationDirectory |
The directory where a file is moved to. |
|
element |
The component's container. It is an HTML Element or a jQuery Element when you use jQuery. |
|
errorCode |
The error code. The following error codes are supported:
|
|
errorText |
Allows you to specify the error message. |
|
item |
The file or directory to be moved. |
Select a file/folder and use the Move To context menu or toolbar item to invoke the "Move to" dialog. In the dialog, select the destination directory and click Move.
The component executes the onItemMoving function when a user clicks Move in the dialog.
See Also
onItemRenamed
Name | Type | Description |
---|---|---|
component |
The UI component's instance. |
|
element |
The component's container. It is an HTML Element or a jQuery Element when you use jQuery. |
|
itemName |
The current name of the renamed file or directory. |
|
sourceItem |
The renamed file or directory. |
Select a file/directory and click the Rename context menu or toolbar item to invoke the dialog. In the dialog, enter a new name and click Save.
See Also
onItemRenaming
Name | Type | Description |
---|---|---|
cancel | | |
Allows you to cancel the file or directory rename. |
component |
The UI component's instance. |
|
element |
The component's container. It is an HTML Element or a jQuery Element when you use jQuery. |
|
errorCode |
The error code. The following error codes are supported:
|
|
errorText |
Allows you to specify the error message. |
|
item |
The file or directory to be renamed. |
|
newName |
The new name of the file or directory. This parameter is read-only. |
Select a file/directory and click the Rename context menu or toolbar item to invoke the dialog. In the dialog, enter a new name and click Save.
The component executes the onItemRenaming function when a user enters a new file/directory name and clicks Save in the dialog.
See Also
onOptionChanged
Name | Type | Description |
---|---|---|
value | any |
The modified property's new value. |
previousValue | any |
The UI component's previous value. |
name |
The modified property if it belongs to the first level. Otherwise, the first-level property it is nested into. |
|
fullName |
The path to the modified property that includes all parent properties. |
|
element |
The UI component's container. It is an HTML Element or a jQuery Element when you use jQuery. |
|
component |
The UI component's instance. |
onSelectedFileOpened
Name | Type | Description |
---|---|---|
component |
The UI component's instance. |
|
element |
The UI component's container. It is an HTML Element or a jQuery Element when you use jQuery. |
|
file |
The opened file. |
onSelectionChanged
Name | Type | Description |
---|---|---|
component |
The UI component's instance. |
|
currentDeselectedItemKeys |
The keys of the file system items whose selection has been cleared. |
|
currentSelectedItemKeys |
The keys of the file system items that have been selected. |
|
element |
The UI component's container. It is an HTML Element or a jQuery Element when you use jQuery. |
|
selectedItemKeys |
The keys of all selected file system items. |
|
selectedItems |
The currently selected file system items. |
onToolbarItemClick
Name | Type | Description |
---|---|---|
component |
The UI component's instance. |
|
element |
The UI component's container. It is an HTML Element or a jQuery Element when you use jQuery. |
|
event | Event (jQuery or EventObject) |
The event that caused the function to execute. It is an EventObject or a jQuery.Event when you use jQuery. |
itemData |
The clicked item's data. |
|
itemElement |
The item's container. It is an HTML Element or a jQuery Element when you use jQuery. |
|
itemIndex |
The clicked item's index. |
rtlEnabled
When this property is set to true, the UI component text flows from right to left, and the layout of elements is reversed. To switch the entire application/site to the right-to-left representation, assign true to the rtlEnabled field of the object passed to the DevExpress.config(config) method.
- DevExpress.config({
- rtlEnabled: true
- });
selectionMode
Specifies whether a user can select a single or multiple files and directories in the item view simultaneously.
tabIndex
The value of this property will be passed to the tabindex
attribute of the HTML element that underlies the UI component.
toolbar
The FileManager UI component allows you to add default and custom toolbar items.
Predefined Items
Predefined toolbar items include:
- 'showNavPane' - Shows or hides the navigation panel.
- 'create' - Creates a new directory.
- 'upload' - Uploads a file.
- 'refresh' - Refreshes the file manager content and shows the progress panel.
- 'download' - Downloads a file.
- 'move' - Moves files and directories.
- 'copy' - Copies files and directories.
- 'rename' - Renames files and directories.
- 'delete' - Deletes files and directories.
- 'switchView' - Switches between the 'Details' and 'Thumbnails' file system representation modes.
- 'clearSelection' - Clears selection from files and directories in the Item View area.
To add a predefined item to the toolbar, specify its name and optional settings ('visible', 'location', 'locateInMenu', 'text', 'icon', 'disabled') and add the item to one of the following collections:
items - Displays toolbar items when no file system item is selected.
fileSelectionItems - Displays toolbar items when one or more file system items are selected.
Custom Items
To add a custom toolbar item, specify its text and optional settings (for example, a file extension for the toolbar item that creates a new file) and add the item to one of the following collections:
items - Displays toolbar items when no file system item is selected.
fileSelectionItems - Displays toolbar items when one or more file system items are selected.
The widget property allows you to specify a UI component for a custom toolbar item (dxButton is the default UI component). Use the toolbarItemClick event to handle clicks on custom toolbar items.
width
This property accepts a value of one of the following types:
Number
The width in pixels.String
A CSS-accepted measurement of width. For example,"55px"
,"20vw"
,"80%"
,"auto"
,"inherit"
.Function (deprecated since v21.2)
Refer to the W0017 warning description for information on how you can migrate to viewport units.