Angular FileManager Properties
This section describes properties that configure the FileManager UI component's contents, behavior, and appearance.
See Also
- Configure a Widget: Angular | Vue | React | jQuery | AngularJS | Knockout | ASP.NET MVC 5 | ASP.NET Core
accessKey
Specifies the shortcut key that sets focus on the UI component.
The value of this property will be passed to the accesskey
attribute of the HTML element that underlies the UI component.
activeStateEnabled
Specifies whether or not the UI component changes its state when interacting with a user.
This property is used when the UI component is displayed on a platform whose guidelines include the active state change for UI components.
allowedFileExtensions
Specifies the allowed upload file extensions.
The FileManager UI component cannot upload a file and displays an error message when the file's extension is not allowed.
jQuery
$(function () { $("#file-manager").dxFileManager({ allowedFileExtensions: [".js", ".json", ".css"] // ... }); });
currentPath
Specifies the path that is used when the FileManager is initialized.
jQuery
$(function () { $("#file-manager").dxFileManager({ currentPath: "Documents/Images" // ... }); });
currentPathKeys
Specifies an array of path keys to the current location.
Each path part has each own key. For example, path "folder1/folder2" has two parts: 'folder1' with the 'f1' key and folder2 with the 'f2' key. To open this location, assign the ["f1","f2"] array of strings to the currentPathKeys property value.
jQuery
$(function () { $("#file-manager").dxFileManager({ currentPathKeys: ["EB458000-0341-6943", "92F5-4722-A7D6-98EB"] // ... }); });
customizeDetailColumns
Customizes columns in details view. Applies only if itemView.mode is "details".
The columns before customization.
The columns after customization.
jQuery
$(function() { $("#fileManagerContainer").dxFileManager({ // ... customizeDetailColumns: function(columns) { // ... // Customize the "columns" array objects here // ... return columns; } }); });
Angular
<dx-file-manager ... [customizeDetailColumns]="fileManager_customizeDetailColumns"> </dx-file-manager>
import { Component } from '@angular/core'; @Component({ selector: 'app-root', templateUrl: './app.component.html', styleUrls: ['./app.component.css'] }) export class AppComponent { // Uncomment the following lines if the function should be executed in the component's context // constructor() { // this.fileManager_customizeDetailColumns = this.fileManager_customizeDetailColumns.bind(this); // } fileManager_customizeDetailColumns(columns) { // ... // Customize the "columns" array objects here // ... return columns; } }
import { BrowserModule } from '@angular/platform-browser'; import { NgModule } from '@angular/core'; import { AppComponent } from './app.component'; import { DxFileManagerModule } from 'devextreme-angular'; @NgModule({ declarations: [ AppComponent ], imports: [ BrowserModule, DxFileManagerModule ], providers: [], bootstrap: [AppComponent] }) export class AppModule { }
Vue
<template> <DxFileManager ... :customize-detail-columns="fileManager_customizeDetailColumns" /> </template> <script> import 'devextreme/dist/css/dx.common.css'; import 'devextreme/dist/css/dx.light.css'; import DxFileManager from 'devextreme-vue/file-manager'; export default { components: { DxFileManager }, methods: { fileManager_customizeDetailColumns(columns) { // ... // Customize the "columns" array objects here // ... return columns; } } } </script>
React
import React from 'react'; import 'devextreme/dist/css/dx.common.css'; import 'devextreme/dist/css/dx.light.css'; import FileManager from 'devextreme-react/file-manager'; class App extends React.Component { // Uncomment the following lines if the function should be executed in the component's context // constructor(props) { // super(props); // this.fileManager_customizeDetailColumns = this.fileManager_customizeDetailColumns.bind(this); // } fileManager_customizeDetailColumns(columns) { // ... // Customize the "columns" array objects here // ... return columns; } render() { return ( <FileManager ... customizeDetailColumns={this.fileManager_customizeDetailColumns} /> ); } } export default App;
customizeThumbnail
Allows you to provide custom icons to be used as thumbnails.
The file or folder whose thumbnail is being customized.
An icon to use as a thumbnail.
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
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.
jQuery
$(function(){ $("#fileManagerContainer").dxFileManager({ // ... elementAttr: { id: "elementId", class: "class-name" } }); });
Angular
<dx-file-manager ... [elementAttr]="{ id: 'elementId', class: 'class-name' }"> </dx-file-manager>
import { DxFileManagerModule } from "devextreme-angular"; // ... export class AppComponent { // ... } @NgModule({ imports: [ // ... DxFileManagerModule ], // ... })
Vue
<template> <DxFileManager ... :element-attr="fileManagerAttributes"> </DxFileManager> </template> <script> import DxFileManager from 'devextreme-vue/file-manager'; export default { components: { DxFileManager }, data() { return { fileManagerAttributes: { id: 'elementId', class: 'class-name' } } } } </script>
React
import React from 'react'; import FileManager from 'devextreme-react/file-manager'; class App extends React.Component { fileManagerAttributes = { id: 'elementId', class: 'class-name' } render() { return ( <FileManager ... elementAttr={this.fileManagerAttributes}> </FileManager> ); } } export default App;
fileSystemProvider
Specifies the file system provider.
File system providers are components that provide APIs used to access and modify virtual file systems.
The following example illustrates how to configure an Object file system provider:
jQuery
$(function () { $("#file-manager").dxFileManager({ fileSystemProvider: fileSystem, // ... }); });
var fileSystem = [ { name: "Documents", isDirectory: true, items: [ { name: "Projects", isDirectory: true, items: [ { name: "About.rtf", isDirectory: false, size: 1024 }, { name: "Passwords.rtf", isDirectory: false, size: 2048 } ] }, { name: "About.xml", isDirectory: false, size: 1024 }, //... ], }, { name: "Images", isDirectory: true, items: [ { name: "logo.png", isDirectory: false, size: 20480 }, { name: "banner.gif", isDirectory: false, size: 10240 } ] }, //... ];
Refer to File System Providers for information on supported file system providers.
focusedItemKey
Specifies a key of the initially or currently focused item.
jQuery
$(function() { $("#fileManagerContainer").dxFileManager({ // ... focusedItemKey: "item1_key" }); });
focusStateEnabled
Specifies whether the UI component can be focused using keyboard navigation.
height
Specifies the UI component's 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"
,"80%"
,"inherit"
.Function
A function returning either of the above. For example:JavaScriptheight: function() { return window.innerHeight / 1.5; }
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 folder view.
jQuery
$(function () { $("#file-manager").dxFileManager({ itemView: { mode: "details", showFolders: false, showParentFolder: false } // ... }); });
onContentReady
A function that is executed when the UI component's content is ready and each time the content is changed.
Information about the event.
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. |
|
model |
Model data. Available only when using Knockout. |
onContextMenuItemClick
A function that is executed when a context menu item is clicked.
Information about the event that caused the function's execution.
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 a dxEvent 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. |
|
model |
Model data. Available only if you use Knockout. |
|
viewArea | 'navPane' | 'itemView' |
Specifies whether the context menu is invoked in the navigation panel or in the items area. |
jQuery
$(function() { $("#fileManagerContainer").dxFileManager({ // ... onContextMenuItemClick: function(e) { // Your code goes here } }); });
onCurrentDirectoryChanged
A function that is executed when the current directory is changed.
Information about the event that caused the function's execution.
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. |
|
model |
The model data. Available only if you use Knockout. |
jQuery
$(function() { $("#fileManagerContainer").dxFileManager({ // ... onCurrentDirectoryChanged: function(e) { // Your code goes here } }); });
onDisposing
A function that is executed before the UI component is disposed of.
Information about the event.
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. |
|
model |
Model data. Available only if you use Knockout. |
onErrorOccurred
A function that is executed when an error occurs.
Information about the event that caused the function's execution.
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 |
The error message. |
|
fileSystemItem |
The processed file or directory. |
|
model |
Model data. Available only if you use Knockout. |
jQuery
$(function() { $("#fileManagerContainer").dxFileManager({ // ... onErrorOccurred: function(e) { // Your code goes here } }); });
onFocusedItemChanged
A function that is executed when the focused item is changed.
Information about the event that caused the function's execution.
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. |
|
model |
The model data. Available only if you use Knockout. |
jQuery
$(function() { $("#fileManagerContainer").dxFileManager({ // ... onFocusedItemChanged: function(e) { // Your code goes here } }); });
onInitialized
A function used in JavaScript frameworks to save the UI component instance.
Information about the event.
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. |
onOptionChanged
A function that is executed after a UI component property is changed.
Information about the event.
Name | Type | Description |
---|---|---|
model |
Model data. Available only if you use Knockout. |
|
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. |
|
name |
The modified property if it belongs to the first level. Otherwise, the first-level property it is nested into. |
|
value | any |
The modified property's new value. |
The following example shows how to subscribe to component property changes:
jQuery
$(function() { $("#fileManagerContainer").dxFileManager({ // ... onOptionChanged: function(e) { if(e.name === "changedProperty") { // handle the property change here } } }); });
Angular
<dx-file-manager ... (onOptionChanged)="handlePropertyChange($event)"> </dx-file-manager>
import { Component } from '@angular/core'; @Component({ selector: 'app-root', templateUrl: './app.component.html', styleUrls: ['./app.component.css'] }) export class AppComponent { // ... handlePropertyChange(e) { if(e.name === "changedProperty") { // handle the property change here } } }
import { BrowserModule } from '@angular/platform-browser'; import { NgModule } from '@angular/core'; import { AppComponent } from './app.component'; import { DxFileManagerModule } from 'devextreme-angular'; @NgModule({ declarations: [ AppComponent ], imports: [ BrowserModule, DxFileManagerModule ], providers: [ ], bootstrap: [AppComponent] }) export class AppModule { }
Vue
<template> <DxFileManager ... @option-changed="handlePropertyChange" /> </template> <script> import 'devextreme/dist/css/dx.common.css'; import 'devextreme/dist/css/dx.light.css'; import DxFileManager from 'devextreme-vue/file-manager'; export default { components: { DxFileManager }, // ... methods: { handlePropertyChange: function(e) { if(e.name === "changedProperty") { // handle the property change here } } } } </script>
React
import React from 'react'; import 'devextreme/dist/css/dx.common.css'; import 'devextreme/dist/css/dx.light.css'; import FileManager from 'devextreme-react/file-manager'; const handlePropertyChange = (e) => { if(e.name === "changedProperty") { // handle the property change here } } export default function App() { return ( <FileManager ... onOptionChanged={handlePropertyChange} /> ); }
onSelectedFileOpened
A function that is executed when the selected file is opened.
Information about the event that caused the function's execution.
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. |
|
model |
Model data. Available only if you use Knockout. |
jQuery
$(function() { $("#fileManagerContainer").dxFileManager({ // ... onSelectedFileOpened: function(e) { // Your code goes here } }); });
Angular
<dx-file-manager ... (onSelectedFileOpened)="fileManager_onSelectedFileOpened($event)"> </dx-file-manager>
import { Component } from '@angular/core'; @Component({ selector: 'app-root', templateUrl: './app.component.html', styleUrls: ['./app.component.css'] }) export class AppComponent { fileManager_onSelectedFileOpened(e) { // Your code goes here } }
import { BrowserModule } from '@angular/platform-browser'; import { NgModule } from '@angular/core'; import { AppComponent } from './app.component'; import { DxFileManagerModule } from 'devextreme-angular'; @NgModule({ declarations: [ AppComponent ], imports: [ BrowserModule, DxFileManagerModule ], providers: [], bootstrap: [AppComponent] }) export class AppModule { }
Vue
<template> <DxFileManager ... :selected-file-opened="fileManager_onSelectedFileOpened" /> </template> <script> import 'devextreme/dist/css/dx.common.css'; import 'devextreme/dist/css/dx.light.css'; import DxFileManager from 'devextreme-vue/file-manager'; export default { components: { DxFileManager }, methods: { fileManager_onSelectedFileOpened(e) { // Your code goes here } } } </script>
React
import React from 'react'; import 'devextreme/dist/css/dx.common.css'; import 'devextreme/dist/css/dx.light.css'; import FileManager from 'devextreme-react/file-manager'; class App extends React.Component { fileManager_onSelectedFileOpened(e) { // Your code goes here } render() { return ( <FileManager ... onSelectedFileOpened={this.fileManager_onSelectedFileOpened} /> ); } } export default App;
onSelectionChanged
A function that is executed when a file system item is selected or selection is canceled.
Information about the event that caused the function's execution.
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. |
|
model |
Model data. Available only if you use Knockout. |
|
selectedItemKeys |
The keys of all selected file system items. |
|
selectedItems |
The currently selected file system items. |
jQuery
$(function() { $("#fileManagerContainer").dxFileManager({ // ... onSelectionChanged: function(e) { // Your code goes here } }); });
onToolbarItemClick
A function that is executed when a toolbar item is clicked.
Information about the event that caused the function's execution.
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 a dxEvent 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. |
|
model |
Model data. Available only if you use Knockout. |
jQuery
$(function() { $("#fileManagerContainer").dxFileManager({ // ... onToolbarItemClick: function(e) { // Your code goes here } }); });
permissions
Specifies actions that a user is allowed to perform on files and folders.
jQuery
$(function () { $("#file-manager").dxFileManager({ permissions: { create: true, copy: true, move: true, remove: true, rename: true }, // ... }); });
rootFolderName
Specifies the root folder name.
jQuery
$(function () { $("#file-manager").dxFileManager({ rootFolderName: "~/Files" // ... }); });
rtlEnabled
Switches the UI component to a right-to-left representation.
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 });
See Also
- Right-to-Left Support Demo: DataGrid | Navigation Widgets | Editors
selectedItemKeys
Contains an array of initially or currently selected files and directories' keys.
jQuery
$(function() { $("#fileManagerContainer").dxFileManager({ // ... selectedItemKeys: ["item1_key", "item2_key", "item3_key"] }); });
selectionMode
Specifies whether a user can select a single or multiple files and folders in the item view simultaneously.
jQuery
$(function () { $("#file-manager").dxFileManager({ selectionMode: "single" // ... }); });
tabIndex
Specifies the number of the element when the Tab key is used for navigating.
The value of this property will be passed to the tabindex
attribute of the HTML element that underlies the UI component.
width
Specifies the UI component's 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"
,"80%"
,"auto"
,"inherit"
.Function
A function returning either of the above. For example:JavaScriptwidth: function() { return window.innerWidth / 1.5; }
If you have technical questions, please create a support ticket in the DevExpress Support Center.