Skip to content
This repository has been archived by the owner. It is now read-only.

Latest commit

 

History

History
4349 lines (3430 loc) · 101 KB

File metadata and controls

4349 lines (3430 loc) · 101 KB
layout post
title Properties, Methods and Events of FileExplorer Widget
description API reference for FileExplorer
documentation API
platform angular-api
keywords FileExplorer, Essential Angular FileExplorer, FileExplorer API

ejFileExplorer

FileExplorer provides a Windows Explorer-like functionality for any web application. It allows end-users to browse, select and upload files or change the folder structure by renaming, moving and deleting files or folders. File and folder management capabilities are fully customizable and can be disabled when necessary.

Syntax

{% highlight html %}

{% endhighlight %}

Name Type Description
options object settings for FileExplorer.

Example

{% highlight html %}

{% endhighlight %}

Requires

  • module:jQuery

  • module:jsrender.min.js

  • module:ej.core.js

  • module:ej.data.js

  • module:ej.globalize.js

  • module:ej.scroller.js

  • module:ej.draggable.js

  • module:ej.button.js

  • module:ej.treeview.js

  • module:ej.uploadbox.js

  • module:ej.waitingpopup.js

  • module:ej.dialog.js

  • module:ej.splitter.js

  • module:ej.toolbar.js

  • module:ej.tooltip.js

  • module:ej.menu.js

  • module:ej.fileexplorer.js

  • module:ej.checkbox.js

  • module:ej.splitbutton.js

  • module:ej.grid.edit.js

  • module:ej.grid.filter.js

  • module:ej.grid.selection.js

  • module:ej.gridresize.js

  • module:ej.grid.sort.js

  • module:ej.grid.dragAndDrop.js

  • module:ej.grid.common.js

  • module:ej.grid.base.js

Members

ajaxAction string

{:#members:ajaxaction}

Sets the URL of server side AJAX handling method that handles file operation like Read, Remove, Rename, Create, Upload, Download, Copy and Move in FileExplorer.

Default Value

  • ""

Example

{% highlight html %}

{% endhighlight %}

ajaxDataType string

{:#members:ajaxdatatype}

Specifies the data type of server side AJAX handling method.

Default Value

  • "json"

Example

{% highlight html %}

{% endhighlight %}

ajaxSettings object

{:#members:ajaxsettings}

By using ajaxSettings property, you can customize the AJAX configurations. Normally you can customize the following option in AJAX handling data, URL, type, async, contentType, dataType and success. For upload, download and getImage API, you can only customize URL.

Default Value

  • { read: {}, createFolder: {}, remove: {}, rename: {}, paste: {}, getDetails: {}, download: {}, upload: {}, getImage: {}, search: {}}

Example

{% highlight html %}

<ej-fileexplorer id="fileExplorer" path= "http://js.syncfusion.com/demos/ejServices/Content/FileBrowser/" ajaxAction="http://js.syncfusion.com/demos/ejServices/api/FileExplorer/FileOperations" [ajaxSettings]="ajaxSettings" style="display:block">

{% endhighlight %}

{% highlight ts %}

export class AppComponent { ajaxSettings: Object; constructor() { let ajaxJSONPActionHandler = "http://js.syncfusion.com/demos/ejServices/api/FileExplorer/FileOperationsCors"; this.ajaxSettings={ read: { url: ajaxJSONPActionHandler, dataType: "jsonp" } }; } }

{% endhighlight %}

allowDragAndDrop boolean

{:#members:allowdraganddrop}

The FileExplorer allows to move the files from one folder to another folder of FileExplorer by using drag and drop option. Also it supports to upload a file by dragging it from windows explorer to the necessary folder of ejFileExplorer.

Default Value

  • true

Example

{% highlight html %}

<ej-fileexplorer id="fileExplorer" path= "http://js.syncfusion.com/demos/ejServices/Content/FileBrowser/" ajaxAction="http://js.syncfusion.com/demos/ejServices/api/FileExplorer/FileOperations" [allowDragAndDrop]="false" style="display:block">

{% endhighlight %}

allowKeyboardNavigation boolean

{:#members:allowkeyboardnavigation}

Gets or sets a value that indicates whether to enable keyboard support for FileExplorer actions.

Default Value

  • true

Example

{% highlight html %}

<ej-fileexplorer id="fileExplorer" path= "http://js.syncfusion.com/demos/ejServices/Content/FileBrowser/" ajaxAction="http://js.syncfusion.com/demos/ejServices/api/FileExplorer/FileOperations" [allowKeyboardNavigation]="false" style="display:block">

{% endhighlight %}

allowMultiSelection boolean

{:#members:allowmultiselection}

The FileExplorer allows to select multiple files by enabling the allowMultiSelection property. You can perform multi selection by pressing the Ctrl key or Shift key.

Default Value

  • true

Example

{% highlight html %}

<ej-fileexplorer id="fileExplorer" path= "http://js.syncfusion.com/demos/ejServices/Content/FileBrowser/" ajaxAction="http://js.syncfusion.com/demos/ejServices/api/FileExplorer/FileOperations" [allowMultiSelection]="false" style="display:block">

{% endhighlight %}

contextMenuSettings object

{:#members:contextmenusettings}

By using the contextMenuSettings property, you can customize the ContextMenu in the FileExplorer control.

contextMenuSettings.items object

{:#members:contextmenusettings-items}

The items property is used to configure and group the required ContextMenu items in FileExplorer control.

Default Value

  • {% highlight javascript %} { navbar: ["NewFolder", "Upload", "|", "Delete", "Rename", "|", "Cut", "Copy", "Paste", "|", "Getinfo"], cwd: ["Refresh", "Paste","|", "SortBy", "|", "NewFolder", "Upload", "|", "Getinfo"], files: ["Open", "Download", "|", "Upload", "|", "Delete", "Rename", "|", "Cut", "Copy", "Paste", "|", "OpenFolderLocation", "Getinfo"] } {% endhighlight %}

Example

{% highlight html %}

<ej-fileexplorer id="fileExplorer" path= "http://js.syncfusion.com/demos/ejServices/Content/FileBrowser/" ajaxAction="http://js.syncfusion.com/demos/ejServices/api/FileExplorer/FileOperations" [contextMenuSettings]="contextMenuSettings" style="display:block">

{% endhighlight %}

{% highlight ts %}

export class AppComponent { contextMenuSettings: Object; constructor() { this.contextMenuSettings = { // define the ContextMenu items items: { // removed the 'NewFolder' item from NavigationPane ContextMenu navbar: ['Upload', '|', 'Delete', 'Rename', '|', 'Cut', 'Copy', 'Paste', '|', 'Getinfo'], // added the custom ContextMenu item (View) to Current working directory ContextMenu cwd: ['Refresh', 'Paste', '|', 'SortBy', 'View', '|', 'NewFolder', 'Upload', '|', 'Getinfo'], // removed 'Upload' item from Selected files/ folder's ContextMenu files: ['Open', 'Download', '|', 'Delete', 'Rename', '|', 'Cut', 'Copy', 'Paste', '|', 'OpenFolderLocation', 'Getinfo'] } }; } }

{% endhighlight %}

contextMenuSettings.customMenuFields array

{:#members:contextmenusettings-custommenufields}

The customMenuFields property is used to define custom functionality for custom ContextMenu item's which are defined in items property.

Default Value

  • []

Example

{% highlight html %}

<ej-fileexplorer id="fileExplorer" path= "http://js.syncfusion.com/demos/ejServices/Content/FileBrowser/" ajaxAction="http://js.syncfusion.com/demos/ejServices/api/FileExplorer/FileOperations" [contextMenuSettings]="contextMenuSettings" style="display:block">

{% endhighlight %}

{% highlight ts %}

export class AppComponent { contextMenuSettings: Object; constructor() { this.contextMenuSettings = { // define the ContextMenu items items: { // removed the 'NewFolder' item from NavigationPane ContextMenu navbar: ['Upload', '|', 'Delete', 'Rename', '|', 'Cut', 'Copy', 'Paste', '|', 'Getinfo'], // added the custom ContextMenu item (View) to Current working directory ContextMenu cwd: ['Refresh', 'Paste', '|', 'SortBy', 'View', '|', 'NewFolder', 'Upload', '|', 'Getinfo'], // removed 'Upload' item from Selected files/ folder's ContextMenu files: ['Open', 'Download', '|', 'Delete', 'Rename', '|', 'Cut', 'Copy', 'Paste', '|', 'OpenFolderLocation', 'Getinfo'] }, // added the custom ContextMenu item's (View) functionality customMenuFields: [ { id: 'View', text: 'View by', spriteCssClass: 'custom-grid', child: [ { id: 'tile', text: 'Tile view', action: function (event) { let fileExplorerObj = $('#fileExplorer4').data('ejFileExplorer'); fileExplorerObj.option('layout', event.ID); } }, { id: 'grid', text: 'Grid view', action: function (event) { let fileExplorerObj = $('#fileExplorer4').data('ejFileExplorer'); fileExplorerObj.option('layout', event.ID); } }, { id: 'LargeIcons', text: 'Large icons view', action: function (event) { let fileExplorerObj = $('#fileExplorer4').data('ejFileExplorer'); fileExplorerObj.option('layout', event.ID); } }, ] }, ] }; } }

{% endhighlight %}

cssClass string

{:#members:cssclass}

Sets the root class for FileExplorer theme. This cssClass API allows to use custom skinning option for File Explorer control. By defining the root class by using this API, you have to include this root class in CSS.

Default Value

  • ""

Example

{% highlight html %}

<ej-fileexplorer id="fileExplorer" path= "http://js.syncfusion.com/demos/ejServices/Content/FileBrowser/" ajaxAction="http://js.syncfusion.com/demos/ejServices/api/FileExplorer/FileOperations" [cssClass]="customCss" style="display:block">

{% endhighlight %}

{% highlight ts %}

export class AppComponent { customCss:string;
constructor() { this.customCss = "gradient-lime"; } }

{% endhighlight %}

enablePersistence boolean

{:#members:enablepersistence}

Specify the enablePersistence to FileExplorer to save the current model value in browser cookies for state maintains.

Default Value

  • false

Example

{% highlight html %}

<ej-fileexplorer id="fileExplorer" path= "http://js.syncfusion.com/demos/ejServices/Content/FileBrowser/" ajaxAction="http://js.syncfusion.com/demos/ejServices/api/FileExplorer/FileOperations" [enablePersistence]="true" style="display:block">

{% endhighlight %}

enableResize boolean

{:#members:enableresize}

Enables or disables the resize support in FileExplorer control.

Default Value

  • false

Example

{% highlight html %}

<ej-fileexplorer id="fileExplorer" path= "http://js.syncfusion.com/demos/ejServices/Content/FileBrowser/" ajaxAction="http://js.syncfusion.com/demos/ejServices/api/FileExplorer/FileOperations" [enableResize]="true" style="display:block">

{% endhighlight %}

enableRTL boolean

{:#members:enablertl}

Enables or disables the Right to Left alignment support in FileExplorer control.

Default Value

  • false

Example

{% highlight html %}

<ej-fileexplorer id="fileExplorer" path= "http://js.syncfusion.com/demos/ejServices/Content/FileBrowser/" ajaxAction="http://js.syncfusion.com/demos/ejServices/api/FileExplorer/FileOperations" [enableRTL]="true" style="display:block">

{% endhighlight %}

enableThumbnailCompress boolean

{:#members:enablethumbnailcompress}

Enables or disables the thumbnail image compression option in FileExplorer control. By enabling this option, you can reduce the thumbnail image size while loading.

Default Value

  • false

Example

{% highlight html %}

<ej-fileexplorer id="fileExplorer" path= "http://js.syncfusion.com/demos/ejServices/Content/FileBrowser/" ajaxAction="http://js.syncfusion.com/demos/ejServices/api/FileExplorer/FileOperations" [enableThumbnailCompress]="true" style="display:block">

{% endhighlight %}

fileTypes string

{:#members:filetypes}

Allows specified type of files only to display in FileExplorer control.

Default Value

  • "* . *"

Example

{% highlight html %}

<ej-fileexplorer id="fileExplorer" path= "http://js.syncfusion.com/demos/ejServices/Content/FileBrowser/" ajaxAction="http://js.syncfusion.com/demos/ejServices/api/FileExplorer/FileOperations" [fileTypes]=".png,.gif,.jpg,.jpeg,*.docx" style="display:block">

{% endhighlight %}

filterSettings object

{:#members:filtersettings}

By using filterSettings property, you can customize the search functionality of the search bar in FileExplorer control.

filterSettings.allowSearchOnTyping boolean

{:#members:filtersettings-allowsearchontyping}

It allows to search the text given in search Textbox in every keyup event. When this property was set as false, searching will works only on Enter key and searchbar blur.

Default Value

  • true

Example

{% highlight html %}

<ej-fileexplorer id="fileExplorer" path= "http://js.syncfusion.com/demos/ejServices/Content/FileBrowser/" ajaxAction="http://js.syncfusion.com/demos/ejServices/api/FileExplorer/FileOperations" [filterSettings]="filterSettings" style="display:block">

{% endhighlight %}

{% highlight ts %}

export class AppComponent { filterSettings: Object;
constructor() { this.filterSettings = {allowSearchOnTyping: false}; } }

{% endhighlight %}

filterSettings.caseSensitiveSearch boolean

{:#members:filtersettings-casesensitivesearch}

Enables or disables to perform the filter operation with case sensitive.

Default Value

  • false

Example

{% highlight html %}

<ej-fileexplorer id="fileExplorer" path= "http://js.syncfusion.com/demos/ejServices/Content/FileBrowser/" ajaxAction="http://js.syncfusion.com/demos/ejServices/api/FileExplorer/FileOperations" [filterSettings]="filterSettings" style="display:block">

{% endhighlight %}

{% highlight ts %}

export class AppComponent { filterSettings: Object;
constructor() { this.filterSettings = {caseSensitiveSearch: false}; } }

{% endhighlight %}

filterSettings.filterType enum

{:#members:filtersettings-filtertype}

Sets the search filter type. There are several filter types available such as "startswith", "contains", "endswith". See filterType.

Name Type Default Description
StartsWith string startswith Enum for filter type startswith
Contains string contains Enum for filter type contains
EndsWith string endswith Enum for filter type endswith

Default Value

  • ej.FileExplorer.filterType.Contains

Example

{% highlight html %}

<ej-fileexplorer id="fileExplorer" path= "http://js.syncfusion.com/demos/ejServices/Content/FileBrowser/" ajaxAction="http://js.syncfusion.com/demos/ejServices/api/FileExplorer/FileOperations" [filterSettings]="filterSettings" style="display:block">

{% endhighlight %}

{% highlight ts %}

export class AppComponent { filterSettings: Object;
constructor() { this.filterSettings = {filterType: "startswith"}; } }

{% endhighlight %}

gridSettings object

{:#members:gridsettings}

By using the gridSettings property, you can customize the grid behavior in the FileExplorer control.

gridSettings.allowResizing boolean

{:#members:gridsettings-allowresizing}

Allows to Resize the width of the columns by simply click and move the particular column header line.

Default Value

  • true

Example

{% highlight html %}

<ej-fileexplorer id="fileExplorer" path= "http://js.syncfusion.com/demos/ejServices/Content/FileBrowser/" ajaxAction="http://js.syncfusion.com/demos/ejServices/api/FileExplorer/FileOperations" [gridSettings]="gridSettings" style="display:block">

{% endhighlight %}

{% highlight ts %}

export class AppComponent { gridSettings: Object;
constructor() { this.gridSettings = {allowResizing:false}; } }

{% endhighlight %}

gridSettings.allowSorting boolean

{:#members:gridsettings-allowsorting}

Gets or sets a value that indicates whether to enable the dynamic sorting behavior on grid data. Sorting can be done through clicking on particular column header.

Default Value

  • true

Example

{% highlight html %}

<ej-fileexplorer id="fileExplorer" path= "http://js.syncfusion.com/demos/ejServices/Content/FileBrowser/" ajaxAction="http://js.syncfusion.com/demos/ejServices/api/FileExplorer/FileOperations" [gridSettings]="gridSettings" style="display:block">

{% endhighlight %}

{% highlight ts %}

export class AppComponent { gridSettings: Object;
constructor() { this.gridSettings = {allowSorting:false}; } }

{% endhighlight %}

gridSettings.columns array

{:#members:gridsettings-columns}

Gets or sets an object that indicates to render the grid with specified columns. You can use this property same as the column property in Grid control.

Default Value

  • [{ field: "name", headerText: "Name", width: "30%" }, { field: "dateModified", headerText: "Date Modified", width: "30%" }, { field: "type", headerText: "Type", width: "15%" }, { field: "size", headerText: "Size", width: "12%", textAlign: "right", headerTextAlign: "left" }]

Example

{% highlight html %}

<ej-fileexplorer id="fileExplorer" path= "http://js.syncfusion.com/demos/ejServices/Content/FileBrowser/" ajaxAction="http://js.syncfusion.com/demos/ejServices/api/FileExplorer/FileOperations" [gridSettings]="gridSettings" style="display:block">

{% endhighlight %}

{% highlight ts %}

export class AppComponent { gridSettings: Object;
constructor() { this.gridSettings = {columns:[{ field: "name", headerText: "Name", width: 90 }, { field: "type", headerText: "Type", width: 95 }, { field: "size", headerText: "Size", width: 90 }]}; } }

{% endhighlight %}

height string | number

{:#members:height}

Specifies the height of FileExplorer control.

Default Value

  • 400

Example

{% highlight html %}

<ej-fileexplorer id="fileExplorer" path= "http://js.syncfusion.com/demos/ejServices/Content/FileBrowser/" ajaxAction="http://js.syncfusion.com/demos/ejServices/api/FileExplorer/FileOperations" [height]="height" style="display:block">

{% endhighlight %}

{% highlight ts %}

export class AppComponent { height: string;
constructor() { this.height = "450px"; } }

{% endhighlight %}

isResponsive boolean

{:#members:isresponsive}

Enables or disables the responsive support for FileExplorer control during the window resizing time.

Default Value

  • false

Example

{% highlight html %}

<ej-fileexplorer id="fileExplorer" path= "http://js.syncfusion.com/demos/ejServices/Content/FileBrowser/" ajaxAction="http://js.syncfusion.com/demos/ejServices/api/FileExplorer/FileOperations" [height]="height" [width]="width" [isResponsive]="true" style="display:block">

{% endhighlight %}

{% highlight ts %}

export class AppComponent { height:string; width:string; constructor(){ this.height="50%"; this.width="70%"; } }

{% endhighlight %}

layout enum

{:#members:layout}

Sets the file view type. There are three view types available such as Grid, Tile and Large icons. See layoutType.

Name Description
Tile Supports to display files in tile view
Grid Supports to display files in grid view
LargeIcons Supports to display files as large icons

Default Value

  • ej.FileExplorer.layoutType.Grid

Example

{% highlight html %}

<ej-fileexplorer id="fileExplorer" path= "http://js.syncfusion.com/demos/ejServices/Content/FileBrowser/" ajaxAction="http://js.syncfusion.com/demos/ejServices/api/FileExplorer/FileOperations" [layout]="layout" style="display:block">

{% endhighlight %}

{% highlight ts %}

export class AppComponent { layout:any; constructor(){ this.layout="tile"; } }

{% endhighlight %}

locale string

{:#members:locale}

Sets the culture in FileExplorer.

Default Value

  • "en-US"

Example

{% highlight html %}

<ej-fileexplorer id="fileExplorer" path= "http://js.syncfusion.com/demos/ejServices/Content/FileBrowser/" ajaxAction="http://js.syncfusion.com/demos/ejServices/api/FileExplorer/FileOperations" [locale]="locale" style="display:block">

{% endhighlight %}

{% highlight ts %}

export class AppComponent { locale: string; constructor(){ this.locale="en-US"; } }

{% endhighlight %}

maxHeight string | number

{:#members:maxheight}

Sets the maximum height of FileExplorer control.

Default Value

  • null

Example

{% highlight html %}

<ej-fileexplorer id="fileExplorer" path= "http://js.syncfusion.com/demos/ejServices/Content/FileBrowser/" ajaxAction="http://js.syncfusion.com/demos/ejServices/api/FileExplorer/FileOperations" [maxHeight]="maxHeight" style="display:block">

{% endhighlight %}

{% highlight ts %}

export class AppComponent { maxHeight: number; constructor(){ this.maxHeight=500; } }

{% endhighlight %}

maxWidth string | number

{:#members:maxwidth}

Sets the maximum width of FileExplorer control.

Default Value

  • null

Example

{% highlight html %}

<ej-fileexplorer id="fileExplorer" path= "http://js.syncfusion.com/demos/ejServices/Content/FileBrowser/" ajaxAction="http://js.syncfusion.com/demos/ejServices/api/FileExplorer/FileOperations" [maxWidth]="maxWidth" style="display:block">

{% endhighlight %}

{% highlight ts %}

export class AppComponent { maxWidth: number; constructor(){ this.maxWidth=1000; } }

{% endhighlight %}

minHeight string | number

{:#members:minheight}

Sets the minimum height of FileExplorer control.

Default Value

  • "250px"

Example

{% highlight html %}

<ej-fileexplorer id="fileExplorer" path= "http://js.syncfusion.com/demos/ejServices/Content/FileBrowser/" ajaxAction="http://js.syncfusion.com/demos/ejServices/api/FileExplorer/FileOperations" [minHeight]="minHeight" style="display:block">

{% endhighlight %}

{% highlight ts %}

export class AppComponent { minHeight: number; constructor(){ this.maxWidth=300; } }

{% endhighlight %}

minWidth string | number

{:#members:minwidth}

Sets the minimum width of FileExplorer control.

Default Value

  • "400px"

Example

{% highlight html %}

<ej-fileexplorer id="fileExplorer" path= "http://js.syncfusion.com/demos/ejServices/Content/FileBrowser/" ajaxAction="http://js.syncfusion.com/demos/ejServices/api/FileExplorer/FileOperations" [minWidth]="minWidth" style="display:block">

{% endhighlight %}

{% highlight ts %}

export class AppComponent { minWidth: number; constructor(){ this.maxWidth=300; } }

{% endhighlight %}

path string

{:#members:path}

The property path denotes the filesystem path that are to be explored. The path for the filesystem can be physical path or relative path, but it has to be relevant to where the Web API is hosted.

Default Value

  • ""

Example

{% highlight html %}

{% endhighlight %}

rootFolderName string

{:#members:rootfoldername}

Sets the alias name of root folder name in FileExplorer. It is used to replace the actual root folder name in FileExplorer.

Default Value

  • ""

Example

{% highlight html %}

<ej-fileexplorer id="fileExplorer" path= "http://js.syncfusion.com/demos/ejServices/Content/FileBrowser/" ajaxAction="http://js.syncfusion.com/demos/ejServices/api/FileExplorer/FileOperations" [rootFolderName]="rootFolderName" style="display:block">

{% endhighlight %}

{% highlight ts %}

export class AppComponent { rootFolderName: string; constructor(){ this.rootFolderName="This PC"; // The name to replace your actual root folder name(FileBrowser). } }

{% endhighlight %}

selectedFolder string

{:#members:selectedfolder}

The selectedFolder is used to select the specified folder of FileExplorer control.

Default Value

  • ""

Example

{% highlight html %}

<ej-fileexplorer id="fileExplorer" path= "http://js.syncfusion.com/demos/ejServices/Content/FileBrowser/" ajaxAction="http://js.syncfusion.com/demos/ejServices/api/FileExplorer/FileOperations" [selectedFolder]="selectedFolder" style="display:block">

{% endhighlight %}

{% highlight ts %}

export class AppComponent { selectedFolder: string; constructor(){ this.selectedFolder="http://js.syncfusion.com/demos/ejServices/Content/FileBrowser/Food"; } }

{% endhighlight %}

selectedItems string | array

{:#members:selecteditems}

The selectedItems is used to select the specified items (file, folder) of FileExplorer control.

Default Value

  • ""

Example

{% highlight html %}

<ej-fileexplorer id="fileExplorer" path= "http://js.syncfusion.com/demos/ejServices/Content/FileBrowser/" ajaxAction="http://js.syncfusion.com/demos/ejServices/api/FileExplorer/FileOperations" [selectedItems]="selectedItems" style="display:block">

{% endhighlight %}

{% highlight ts %}

export class AppComponent { selectedItems: String[]; constructor(){ this.selectedItems= ["Food", "Nature"]; } }

{% endhighlight %}

showCheckbox boolean

{:#members:showcheckbox}

Enables or disables the checkbox option in FileExplorer control.

Default Value

  • true

Example

{% highlight html %}

<ej-fileexplorer id="fileExplorer" path= "http://js.syncfusion.com/demos/ejServices/Content/FileBrowser/" ajaxAction="http://js.syncfusion.com/demos/ejServices/api/FileExplorer/FileOperations" [showCheckbox]="false" style="display:block">

{% endhighlight %}

showContextMenu boolean

{:#members:showcontextmenu}

Enables or disables the context menu option in FileExplorer control.

Default Value

  • true

Example

{% highlight html %}

<ej-fileexplorer id="fileExplorer" path= "http://js.syncfusion.com/demos/ejServices/Content/FileBrowser/" ajaxAction="http://js.syncfusion.com/demos/ejServices/api/FileExplorer/FileOperations" [showContextMenu]="false" style="display:block">

{% endhighlight %}

showFooter boolean

{:#members:showfooter}

Enables or disables the footer in FileExplorer control. The footer element displays the details of the current selected files and folders. And also the footer having the switcher to change the layout view.

Default Value

  • true

Example

{% highlight html %}

<ej-fileexplorer id="fileExplorer" path= "http://js.syncfusion.com/demos/ejServices/Content/FileBrowser/" ajaxAction="http://js.syncfusion.com/demos/ejServices/api/FileExplorer/FileOperations" [showFooter]="false" style="display:block">

{% endhighlight %}

showRoundedCorner boolean

{:#members:showroundedcorner}

FileExplorer control is displayed with rounded corner when this property is set to true.

Default Value

  • false

Example

{% highlight html %}

<ej-fileexplorer id="fileExplorer" path= "http://js.syncfusion.com/demos/ejServices/Content/FileBrowser/" ajaxAction="http://js.syncfusion.com/demos/ejServices/api/FileExplorer/FileOperations" [showRoundedCorner]="true" style="display:block">

{% endhighlight %}

showThumbnail boolean

{:#members:showthumbnail}

FileExplorer control is rendered with thumbnail preview of images in Tile and LargeIcons layout when this property set to true.

Default Value

  • true

Example

{% highlight html %}

<ej-fileexplorer id="fileExplorer" path= "http://js.syncfusion.com/demos/ejServices/Content/FileBrowser/" ajaxAction="http://js.syncfusion.com/demos/ejServices/api/FileExplorer/FileOperations" [showThumbnail]="false" style="display:block">

{% endhighlight %}

showToolbar boolean

{:#members:showtoolbar}

Shows or disables the toolbar in FileExplorer control.

Default Value

  • true

Example

{% highlight html %}

<ej-fileexplorer id="fileExplorer" path= "http://js.syncfusion.com/demos/ejServices/Content/FileBrowser/" ajaxAction="http://js.syncfusion.com/demos/ejServices/api/FileExplorer/FileOperations" [showToolbar]="false" style="display:block">

{% endhighlight %}

showNavigationPane boolean

{:#members:shownavigationpane}

Enables or disables the navigation pane in FileExplorer control. The navigation pane contains a tree view element that displays all the folders from the filesystem in a hierarchical manner. This is useful to a quick navigation of any folder in the filesystem.

Default Value

  • true

Example

{% highlight html %}

<ej-fileexplorer id="fileExplorer" path= "http://js.syncfusion.com/demos/ejServices/Content/FileBrowser/" ajaxAction="http://js.syncfusion.com/demos/ejServices/api/FileExplorer/FileOperations" [showNavigationPane]="false" style="display:block">

{% endhighlight %}

tools object

{:#members:tools}

The tools property is used to configure and group required toolbar items in FileExplorer control.

Default Value

  • { creation: ["NewFolder"], navigation: ["Back", "Forward", "Upward"], addressBar: ["Addressbar"], editing: ["Refresh", "Upload", "Delete", "Rename", "Download"], copyPaste: ["Cut", "Copy", "Paste"], getProperties: ["Details"], searchBar: ["Searchbar"], layout: ["Layout"], sortBy: ["SortBy"]}

Example

{% highlight html %}

<ej-fileexplorer id="fileExplorer" path= "http://js.syncfusion.com/demos/ejServices/Content/FileBrowser/" ajaxAction="http://js.syncfusion.com/demos/ejServices/api/FileExplorer/FileOperations" [tools]="tools" style="display:block">

{% endhighlight %}

{% highlight ts %}

export class AppComponent { tools: Object; constructor() { // defines the tool items for customTool category this.tools= { customTool: [{ creation:["NewFolder", "Open"], navigation: ["Back", "Forward", "Upward"], addressBar: ["Addressbar"], editing: ["Refresh", "Upload", "Delete", "Rename", "Download"], copyPaste: ["Cut", "Copy", "Paste"], getProperties: ["Details"], searchBar: ["Searchbar"] }] }; } }

{% endhighlight %}

toolsList array

{:#members:toolslist}

The toolsList property is used to arrange the toolbar items in the FileExplorer control.

Default Value

  • ["layout", "creation", "navigation", "addressBar", "editing", "copyPaste", "sortBy", "getProperties", "searchBar"]

Example

{% highlight html %}

<ej-fileexplorer id="fileExplorer" path= "http://js.syncfusion.com/demos/ejServices/Content/FileBrowser/" ajaxAction="http://js.syncfusion.com/demos/ejServices/api/FileExplorer/FileOperations" [toolsList]="toolsList" style="display:block">

{% endhighlight %}

{% highlight ts %}

export class AppComponent { toolsList: Object; constructor() { // defines the tool items for customTool category this.toolsList= ["navigation", "creation", "addressBar", "editing", "copyPaste", "getProperties", "searchBar"]; } }

{% endhighlight %}

uploadSettings object

{:#members:uploadsettings}

Gets or sets an object that indicates whether to customize the upload behavior in the FileExplorer.

uploadSettings.maxFileSize number

{:#members:uploadsettings-maxfilesize}

Specifies the maximum file size allowed to upload. It accepts the value in bytes.

Default Value

  • 31457280

Example

{% highlight html %}

<ej-fileexplorer id="fileExplorer" path= "http://js.syncfusion.com/demos/ejServices/Content/FileBrowser/" ajaxAction="http://js.syncfusion.com/demos/ejServices/api/FileExplorer/FileOperations" [uploadSettings]="uploadSettings" style="display:block">

{% endhighlight %}

{% highlight ts %}

export class AppComponent { uploadSettings: Object; constructor() { // defines the tool items for customTool category this.uploadSettings= {maxFileSize:10000}; } }

{% endhighlight %}

uploadSettings.allowMultipleFile boolean

{:#members:uploadsettings-allowmultiplefile}

Enables or disables the multiple files upload. When it is enabled, you can upload multiple files at a time and when disabled, you can upload only one file at a time.

Default Value

  • true

Example

{% highlight html %}

<ej-fileexplorer id="fileExplorer" path= "http://js.syncfusion.com/demos/ejServices/Content/FileBrowser/" ajaxAction="http://js.syncfusion.com/demos/ejServices/api/FileExplorer/FileOperations" [uploadSettings]="uploadSettings" style="display:block">

{% endhighlight %}

{% highlight ts %}

export class AppComponent { uploadSettings: Object; constructor() { // defines the tool items for customTool category this.uploadSettings= {allowMultipleFile:false}; } }

{% endhighlight %}

uploadSettings.autoUpload boolean

{:#members:uploadsettings-autoupload}

Enables or disables the auto upload option while uploading files in FileExplorer control.

Default Value

  • false

Example

{% highlight html %}

<ej-fileexplorer id="fileExplorer" path= "http://js.syncfusion.com/demos/ejServices/Content/FileBrowser/" ajaxAction="http://js.syncfusion.com/demos/ejServices/api/FileExplorer/FileOperations" [uploadSettings]="uploadSettings" style="display:block">

{% endhighlight %}

{% highlight ts %}

export class AppComponent { uploadSettings: Object; constructor() { // defines the tool items for customTool category this.uploadSettings= {autoUpload:true}; } }

{% endhighlight %}

width string | number

{:#members:width}

Specifies the width of FileExplorer control.

Default Value

  • 850

Example

{% highlight html %}

<ej-fileexplorer id="fileExplorer" path= "http://js.syncfusion.com/demos/ejServices/Content/FileBrowser/" ajaxAction="http://js.syncfusion.com/demos/ejServices/api/FileExplorer/FileOperations" [width]="width" style="display:block">

{% endhighlight %}

{% highlight ts %}

export class AppComponent { width: number; constructor() { // defines the tool items for customTool category this.width= 800; } }

{% endhighlight %}

Methods

adjustSize()

{:#methods:adjustsize}

Refresh the size of FileExplorer control.

Example

{% highlight html %}

{% endhighlight %}

{% highlight ts %}

// Create FileExplorer instance var fileExplorerObj = $("#fileExplorer").data("ejFileExplorer"); fileExplorerObj.adjustSize(); // refresh the size of file explorer

{% endhighlight %}

disableMenuItem(item)

{:#methods:disablemenuitem}

Disable the particular context menu item.

Name Type Description
item string | element Id of the menu item/ Menu element to be disabled

Example

{% highlight html %}

{% endhighlight %}

{% highlight ts %}

// Create FileExplorer instance var fileExplorerObj = $("#fileExplorer").data("ejFileExplorer"); fileExplorerObj.disableMenuItem("Upload"); // disable upload option

{% endhighlight %}

disableToolbarItem(item)

{:#methods:disabletoolbaritem}

Disable the particular toolbar item.

Name Type Description
item string | element Id of the toolbar item/ Tool item element to be disabled

Example

{% highlight html %}

{% endhighlight %}

{% highlight ts %}

// Create FileExplorer instance var fileExplorerObj = $("#fileExplorer").data("ejFileExplorer"); fileExplorerObj.disableToolbarItem("Searchbar"); // disable search bar

{% endhighlight %}

enableMenuItem(item)

{:#methods:enablemenuitem}

Enable the particular context menu item.

Name Type Description
item string | Element Id of the menu item/ Menu element to be Enabled

Example

{% highlight html %}

{% endhighlight %}

{% highlight ts %}

// Create FileExplorer instance var fileExplorerObj = $("#fileExplorer").data("ejFileExplorer"); fileExplorerObj.enableMenuItem("Upload"); // enable upload option in context menu

{% endhighlight %}

enableToolbarItem(item)

{:#methods:enabletoolbaritem}

Enable the particular toolbar item

Name Type Description
item string | Element Id of the tool item/ Tool item element to be Enabled

Example

{% highlight html %}

{% endhighlight %}

{% highlight ts %}

// Create FileExplorer instance var fileExplorerObj = $("#fileExplorer").data("ejFileExplorer"); fileExplorerObj.enableToolbarItem("Searchbar"); // enable search bar

{% endhighlight %}

refresh()

{:#methods:refresh}

Refresh the content of the selected folder in FileExplorer control.

Example

{% highlight html %}

{% endhighlight %}

{% highlight ts %}

// Create FileExplorer instance var fileExplorerObj = $("#fileExplorer").data("ejFileExplorer"); fileExplorerObj.refresh(); // refresh the content of selected folder

{% endhighlight %}

removeToolbarItem(item)

{:#methods:removetoolbaritem}

Remove the particular toolbar item.

Name Type Description
item string | Element Id of the tool item/ tool item element to be removed

Example

{% highlight html %}

{% endhighlight %}

{% highlight ts %}

// Create FileExplorer instance var fileExplorerObj = $("#fileExplorer").data("ejFileExplorer"); fileExplorerObj.removeToolbarItem("Searchbar"); // remove search bar

{% endhighlight %}

Events

beforeAjaxRequest

{:#events:beforeajaxrequest}

Fires before the AJAX request is performed.

Name Type Description
argument Object Event parameters from FileExplorer
Name Type Description
cancel boolean Set to true when the event has to be canceled, else false.
data object returns the AJAX request data
model object returns the FileExplorer model
type string returns the name of the event

Example

{% highlight html %}

<ej-fileexplorer id="fileExplorer" path= "http://js.syncfusion.com/demos/ejServices/Content/FileBrowser/" ajaxAction="http://js.syncfusion.com/demos/ejServices/api/FileExplorer/FileOperations" (beforeAjaxRequest)="onBeforeAjaxRequest($event)" style="display:block">

{% endhighlight %}

{% highlight ts %}

export class AppComponent { constructor(){ } onBeforeAjaxRequest(e: any){ // Your code here }

}

{% endhighlight %}

beforeDownload

{:#events:beforedownload}

Fires before downloading the files.

Name Type Description
argument Object Event parameters from FileExplorer
Name Type Description
cancel boolean Set to true when the event has to be canceled, else false.
files string[] returns the downloaded file names.
model object returns the FileExplorer model.
path string returns the path of currently opened item.
selectedItems object returns the selected item details.
type string returns the name of the event.

Example

{% highlight html %}

<ej-fileexplorer id="fileExplorer" path= "http://js.syncfusion.com/demos/ejServices/Content/FileBrowser/" ajaxAction="http://js.syncfusion.com/demos/ejServices/api/FileExplorer/FileOperations" (beforeDownload)="onBeforeDownload($event)" style="display:block">

{% endhighlight %}

{% highlight ts %}

export class AppComponent { constructor(){ } onBeforeDownload(e: any){ // Your code here }

}

{% endhighlight %}

beforeGetImage

{:#events:beforegetimage}

Fires before getting a requested image from server. Also this event will be triggered when you have enabled thumbnail image compression option in FileExplorer. Using this event, you can customize the image compression size.

Name Type Description
path String Image path
Name Type Description
cancel boolean set to true when the event has to be canceled, else false.
canCompress boolean enable or disable the image compress option.
model object returns the FileExplorer model.
size object returns the expected image size.
selectedItems object returns the selected item details.
type string returns the name of the event.

Example

{% highlight html %}

<ej-fileexplorer id="fileExplorer" path= "http://js.syncfusion.com/demos/ejServices/Content/FileBrowser/" ajaxAction="http://js.syncfusion.com/demos/ejServices/api/FileExplorer/FileOperations" (beforeGetImage)="onBeforeGetImage($event)" style="display:block">

{% endhighlight %}

{% highlight ts %}

export class AppComponent { constructor(){ } onBeforeGetImage(e: any){ // Your code here }

}

{% endhighlight %}

beforeOpen

{:#events:beforeopen}

Fires before files or folders open.

Name Type Description
argument Object Event parameters from FileExplorer
Name Type Description
cancel boolean Set to true when the event has to be canceled, else false.
itemType string returns the opened item type.
model object returns the FileExplorer model.
path string returns the path of currently opened item.
selectedItems object returns the selected item details.
type string returns the name of the event.

Example

{% highlight html %}

<ej-fileexplorer id="fileExplorer" path= "http://js.syncfusion.com/demos/ejServices/Content/FileBrowser/" ajaxAction="http://js.syncfusion.com/demos/ejServices/api/FileExplorer/FileOperations" (beforeOpen)="onBeforeOpen($event)" style="display:block">

{% endhighlight %}

{% highlight ts %}

export class AppComponent { constructor(){ } onBeforeOpen(e: any){ // Your code here }

}

{% endhighlight %}

beforeUpload

{:#events:beforeupload}

Fires before uploading the files.

Name Type Description
argument Object Event parameters from FileExplorer
Name Type Description
cancel boolean Set to true when the event has to be canceled, else false.
model object returns the FileExplorer model.
path string returns the path of currently opened item.
selectedItems object returns the selected item details.
uploadItemDetails object returns the upload item details.
type string returns the name of the event.

Example

{% highlight html %}

<ej-fileexplorer id="fileExplorer" path= "http://js.syncfusion.com/demos/ejServices/Content/FileBrowser/" ajaxAction="http://js.syncfusion.com/demos/ejServices/api/FileExplorer/FileOperations" (beforeUpload)="onBeforeUpload($event)" style="display:block">

{% endhighlight %}

{% highlight ts %}

export class AppComponent { constructor(){ } onBeforeUpload(e: any){ // Your code here }

}

{% endhighlight %}

create

{:#events:create}

Fires when FileExplorer control was created

Name Type Description
cancel boolean Set to true when the event has to be canceled, else false.
model object returns the FileExplorer model.
type string returns the name of the event.

Example

{% highlight html %}

<ej-fileexplorer id="fileExplorer" path= "http://js.syncfusion.com/demos/ejServices/Content/FileBrowser/" ajaxAction="http://js.syncfusion.com/demos/ejServices/api/FileExplorer/FileOperations" (create)="onCreate($event)" style="display:block">

{% endhighlight %}

{% highlight ts %}

export class AppComponent { constructor(){ } onCreate(e: any){ // Your code here }

}

{% endhighlight %}

copy

{:#events:copy}

Fires when file or folder is copied successfully.

Name Type Description
argument Object Event parameters from FileExplorer
Name Type Description
cancel boolean Set to true when the event has to be canceled, else false.
model object returns the FileExplorer model.
name string[] returns the name of copied file/folder.
selectedItems object returns the selected item details.
sourcePath string returns the source path.
type string returns the name of the event.

Example

{% highlight html %}

<ej-fileexplorer id="fileExplorer" path= "http://js.syncfusion.com/demos/ejServices/Content/FileBrowser/" ajaxAction="http://js.syncfusion.com/demos/ejServices/api/FileExplorer/FileOperations" (copy)="onCopy($event)" style="display:block">

{% endhighlight %}

{% highlight ts %}

export class AppComponent { constructor(){ } onCopy(e: any){ // Your code here }

}

{% endhighlight %}

createFolder

{:#events:createfolder}

Fires when new folder is created successfully in file system.

Name Type Description
argument Object Event parameters from FileExplorer
Name Type Description
cancel boolean Set to true when the event has to be canceled, else false.
data object returns the AJAX response data
model object returns the FileExplorer model
selectedItems object returns the selected item details
type string returns the name of the event.

Example

{% highlight html %}

<ej-fileexplorer id="fileExplorer" path= "http://js.syncfusion.com/demos/ejServices/Content/FileBrowser/" ajaxAction="http://js.syncfusion.com/demos/ejServices/api/FileExplorer/FileOperations" (createFolder)="onCreateFolder($event)" style="display:block">

{% endhighlight %}

{% highlight ts %}

export class AppComponent { constructor(){ } onCreateFolder(e: any){ // Your code here }

}

{% endhighlight %}

cut

{:#events:cut}

Fires when file or folder is cut successfully.

Name Type Description
argument Object Event parameters from FileExplorer
Name Type Description
cancel boolean Set to true when the event has to be canceled, else false.
model object returns the FileExplorer model.
name string[] returns the name of moved file or folder.
selectedItems object returns the selected item details.
sourcePath string returns the source path.
type string returns the name of the event.

Example

{% highlight html %}

<ej-fileexplorer id="fileExplorer" path= "http://js.syncfusion.com/demos/ejServices/Content/FileBrowser/" ajaxAction="http://js.syncfusion.com/demos/ejServices/api/FileExplorer/FileOperations" (cut)="onCut($event)" style="display:block">

{% endhighlight %}

{% highlight ts %}

export class AppComponent { constructor(){ } onCut(e: any){ // Your code here }

}

{% endhighlight %}

destroy

{:#events:destroy}

Fires when the FileExplorer is destroyed successfully.

Name Type Description
cancel boolean Set to true when the event has to be canceled, else false.
model object returns the FileExplorer model.
type string returns the name of the event.

Example

{% highlight html %}

<ej-fileexplorer id="fileExplorer" path= "http://js.syncfusion.com/demos/ejServices/Content/FileBrowser/" ajaxAction="http://js.syncfusion.com/demos/ejServices/api/FileExplorer/FileOperations" (destroy)="onDestroy($event)" style="display:block">

{% endhighlight %}

{% highlight ts %}

export class AppComponent { constructor(){ } onDestroy(e: any){ // Your code here }

}

{% endhighlight %}

dragStart

{:#events:dragstart}

Fires when the files or directory has been started to drag over on the FileExplorer

Name Type Description
cancel boolean set to true when the event has to be canceled, else false.
model object returns the FileExplorer model.
type string returns the name of the event.
target object returns the dragging element.
targetPath string returns the path of dragging element.
selectedItems object returns the dragging file details.

Example

{% highlight html %}

<ej-fileexplorer id="fileExplorer" path= "http://js.syncfusion.com/demos/ejServices/Content/FileBrowser/" ajaxAction="http://js.syncfusion.com/demos/ejServices/api/FileExplorer/FileOperations" (dragStart)="onDragStart($event)" style="display:block">

{% endhighlight %}

{% highlight ts %}

export class AppComponent { constructor(){ } onDragStart(e: any){ // Your code here }

}

{% endhighlight %}

drag

{:#events:drag}

Fires when the files or directory is dragging over on the FileExplorer.

Name Type Description
cancel boolean set to true when the event has to be canceled, else false.
model object returns the FileExplorer model.
type string returns the name of the event.
target object returns the target element.
targetElementName string returns the name of target element.
targetPath string returns the path of target element.

Example

{% highlight html %}

<ej-fileexplorer id="fileExplorer" path= "http://js.syncfusion.com/demos/ejServices/Content/FileBrowser/" ajaxAction="http://js.syncfusion.com/demos/ejServices/api/FileExplorer/FileOperations" (drag)="onDrag($event)" style="display:block">

{% endhighlight %}

{% highlight ts %}

export class AppComponent { constructor(){ } onDrag(e: any){ // Your code here }

}

{% endhighlight %}

dragStop

{:#events:dragstop}

Fires when the files or directory has been stopped to drag over on FileExplorer

Name Type Description
cancel boolean set to true when the event has to be canceled, else false.
model object returns the FileExplorer model.
type string returns the name of the event.
target object returns the target element.
targetPath string returns the path of target element.
targetElementName string returns the name of target element
dropAction string returns the action, which is performed after dropping the files (upload/ move).
fileInfo object returns the dragging file details

Example

{% highlight html %}

<ej-fileexplorer id="fileExplorer" path= "http://js.syncfusion.com/demos/ejServices/Content/FileBrowser/" ajaxAction="http://js.syncfusion.com/demos/ejServices/api/FileExplorer/FileOperations" (dragStop)="onDragStop($event)" style="display:block">

{% endhighlight %}

{% highlight ts %}

export class AppComponent { constructor(){ } onDragStop(e: any){ // Your code here }

}

{% endhighlight %}

drop

{:#events:drop}

Fires when the files or directory is dropped to the target folder of FileExplorer

Name Type Description
cancel boolean set to true when the event has to be canceled, else false.
model object returns the FileExplorer model.
type string returns the name of the event.
target object returns the target element.
targetFolder string returns the name of target folder.
targetPath string returns the path of target folder.
fileInfo object returns the dragging element details.
dropAction string returns the action, which is performed after dropping the files (upload/ move).

Example

{% highlight html %}

<ej-fileexplorer id="fileExplorer" path= "http://js.syncfusion.com/demos/ejServices/Content/FileBrowser/" ajaxAction="http://js.syncfusion.com/demos/ejServices/api/FileExplorer/FileOperations" (drop)="onDrop($event)" style="display:block">

{% endhighlight %}

{% highlight ts %}

export class AppComponent { constructor(){ } onDrop(e: any){ // Your code here }

}

{% endhighlight %}

getImage

{:#events:getimage}

Fires after loading the requested image from server. Using this event, you can get the details of loaded image.

Name Type Description
cancel boolean set to true when the event has to be canceled, else false.
path string loaded image path.
element object loaded image element
model object returns the FileExplorer model.
originalArgs object original arguments of image load or error event
action string returns the action type, which specifies thumbnail preview or opening image.
type string returns the name of the event.

Example

{% highlight html %}

<ej-fileexplorer id="fileExplorer" path= "http://js.syncfusion.com/demos/ejServices/Content/FileBrowser/" ajaxAction="http://js.syncfusion.com/demos/ejServices/api/FileExplorer/FileOperations" (getImage)="onGetImage($event)" style="display:block">

{% endhighlight %}

{% highlight ts %}

export class AppComponent { constructor(){ } onGetImage(e: any){ // Your code here }

}

{% endhighlight %}

keydown

{:#events:keydown}

Fires when keydown in FileExplorer control.

Name Type Description
cancel boolean Set to true when the event has to be canceled, else false.
keyCode number returns the downed key keyCode value
altKey boolean returns altKey value.
shiftKey boolean returns shiftKey value.
ctrlKey boolean returns ctrlKey value.
originalArgs object returns the event object.
model object returns the FileExplorer model.
type string returns the name of the event.

Example

{% highlight html %}

<ej-fileexplorer id="fileExplorer" path= "http://js.syncfusion.com/demos/ejServices/Content/FileBrowser/" ajaxAction="http://js.syncfusion.com/demos/ejServices/api/FileExplorer/FileOperations" (keydown)="onKeydown($event)" style="display:block">

{% endhighlight %}

{% highlight ts %}

export class AppComponent { constructor(){ } onKeydown(e: any){ // Your code here }

}

{% endhighlight %}

layoutChange

{:#events:layoutchange}

Fires when the file view type is changed.

Name Type Description
argument Object Event parameters from FileExplorer
Name Type Description
cancel boolean Set to true when the event has to be canceled, else false.
isInteraction boolean return true when we change the layout via interaction, else false.
layoutType string returns the current view type.
model object returns the FileExplorer model.
type string returns the name of the event.

Example

{% highlight html %}

<ej-fileexplorer id="fileExplorer" path= "http://js.syncfusion.com/demos/ejServices/Content/FileBrowser/" ajaxAction="http://js.syncfusion.com/demos/ejServices/api/FileExplorer/FileOperations" (layoutChange)="onLayoutChange($event)" style="display:block">

{% endhighlight %}

{% highlight ts %}

export class AppComponent { constructor(){ } onLayoutChange(e: any){ // Your code here }

}

{% endhighlight %}

menuBeforeOpen

{:#events:menubeforeopen}

Fires when before the ContextMenu opening.

Name Type Description
argument Object Event parameters from FileExplorer
Name Type Description
cancel boolean set to true when the event has to be canceled, else false.
contextMenu string returns the name of ContextMenu items group.
dataSource array returns the dataSource of ContextMenu.
element object returns the element of ContextMenu.
events object returns the event of ContextMenu.
model object returns the FileExplorer model.
target object returns the target element.
type string returns the name of the event.

Example

{% highlight html %}

<ej-fileexplorer id="fileExplorer" path= "http://js.syncfusion.com/demos/ejServices/Content/FileBrowser/" ajaxAction="http://js.syncfusion.com/demos/ejServices/api/FileExplorer/FileOperations" (menuBeforeOpen)="menuBeforeOpen($event)" style="display:block">

{% endhighlight %}

{% highlight ts %}

export class AppComponent { constructor(){ } menuBeforeOpen(e: any){ // Your code here }

}

{% endhighlight %}

menuClick

{:#events:menuclick}

Fires when click the ContextMenu item.

Name Type Description
argument Object Event parameters from FileExplorer
Name Type Description
ID string returns the ID of clicked ContextMenu item.
cancel boolean set to true when the event has to be canceled, else false.
contextMenu string returns the name of ContextMenu items group.
element object returns the element of clicked ContextMenu item.
event object returns the event of ContextMenu.
model object returns the FileExplorer model.
parentId string returns the parent element ID of clicked ContextMenu item.
parentText string returns the parent element text of clicked ContextMenu item.
text string returns the text of clicked ContextMenu item.
type string returns the name of the event.

Example

{% highlight html %}

<ej-fileexplorer id="fileExplorer" path= "http://js.syncfusion.com/demos/ejServices/Content/FileBrowser/" ajaxAction="http://js.syncfusion.com/demos/ejServices/api/FileExplorer/FileOperations" (menuClick)="onMenuClick($event)" style="display:block">

{% endhighlight %}

{% highlight ts %}

export class AppComponent { constructor(){ } onMenuClick(e: any){ // Your code here }

}

{% endhighlight %}

menuOpen

{:#events:menuopen}

Fires when ContextMenu is successfully opened.

Name Type Description
argument Object Event parameters from FileExplorer
Name Type Description
cancel boolean set to true when the event has to be canceled, else false.
contextMenu string returns the name of ContextMenu items group.
element object returns the element of ContextMenu.
model object returns the FileExplorer model.
target object returns the target element.
type string returns the name of the event.

Example

{% highlight html %}

<ej-fileexplorer id="fileExplorer" path= "http://js.syncfusion.com/demos/ejServices/Content/FileBrowser/" ajaxAction="http://js.syncfusion.com/demos/ejServices/api/FileExplorer/FileOperations" (menuOpen)="onMenuOpen($event)" style="display:block">

{% endhighlight %}

{% highlight ts %}

export class AppComponent { constructor(){ } onMenuOpen(e: any){ // Your code here }

}

{% endhighlight %}

open

{:#events:open}

Fires when files are successfully opened.

Name Type Description
argument Object Event parameters from FileExplorer
Name Type Description
cancel boolean Set to true when the event has to be canceled, else false.
itemType string returns the opened item type.
model object returns the FileExplorer model.
path string returns the path of currently opened item.
selectedItems object returns the selected item details.
type string returns the name of the event.

Example

{% highlight html %}

<ej-fileexplorer id="fileExplorer" path= "http://js.syncfusion.com/demos/ejServices/Content/FileBrowser/" ajaxAction="http://js.syncfusion.com/demos/ejServices/api/FileExplorer/FileOperations" (open)="onOpen($event)" style="display:block">

{% endhighlight %}

{% highlight ts %}

export class AppComponent { constructor(){ } onOpen(e: any){ // Your code here }

}

{% endhighlight %}

paste

{:#events:paste}

Fires when a file or folder is pasted successfully.

Name Type Description
argument Object Event parameters from FileExplorer
Name Type Description
cancel boolean Set to true when the event has to be canceled, else false.
model object returns the FileExplorer model.
name string[] returns the name of moved/copied file or folder.
selectedItems object returns the selected item details.
targetFolder object returns the target folder item details.
targetPath string returns the target path.
type string returns the name of the event.

Example

{% highlight html %}

<ej-fileexplorer id="fileExplorer" path= "http://js.syncfusion.com/demos/ejServices/Content/FileBrowser/" ajaxAction="http://js.syncfusion.com/demos/ejServices/api/FileExplorer/FileOperations" (paste)="onPaste($event)" style="display:block">

{% endhighlight %}

{% highlight ts %}

export class AppComponent { constructor(){ } onPaste(e: any){ // Your code here }

}

{% endhighlight %}

remove

{:#events:remove}

Fires when file or folder is deleted successfully.

Name Type Description
argument Object Event parameters from FileExplorer
Name Type Description
cancel boolean Set to true when the event has to be canceled, else false.
data object returns the AJAX response data.
model object returns the FileExplorer model.
name string returns the names of deleted items.
path string returns the path of deleted item.
selectedItems object returns the removed item details.
type string returns the name of the event.

Example

{% highlight html %}

<ej-fileexplorer id="fileExplorer" path= "http://js.syncfusion.com/demos/ejServices/Content/FileBrowser/" ajaxAction="http://js.syncfusion.com/demos/ejServices/api/FileExplorer/FileOperations" (remove)="onRemove($event)" style="display:block">

{% endhighlight %}

{% highlight ts %}

export class AppComponent { constructor(){ } onRemove(e: any){ // Your code here }

}

{% endhighlight %}

resize

{:#events:resize}

Fires when resizing is performed for FileExplorer.

Name Type Description
argument Object Event parameters from FileExplorer
Name Type Description
cancel boolean if the event should be canceled; otherwise, false.
event object returns the mouse move event args.
model object returns the FileExplorer model.
type string returns the name of the event.

Example

{% highlight html %}

<ej-fileexplorer id="fileExplorer" path= "http://js.syncfusion.com/demos/ejServices/Content/FileBrowser/" ajaxAction="http://js.syncfusion.com/demos/ejServices/api/FileExplorer/FileOperations" (resize)="onResize($event)" style="display:block">

{% endhighlight %}

{% highlight ts %}

export class AppComponent { constructor(){ } onResize(e: any){ // Your code here }

}

{% endhighlight %}

resizeStart

{:#events:resizestart}

Fires when resizing is started for FileExplorer.

Name Type Description
argument Object Event parameters from FileExplorer
Name Type Description
cancel boolean Set to true when the event has to be canceled, else false.
event object returns the mouse down event args.
model object returns the FileExplorer model.
type string returns the name of the event.

Example

{% highlight html %}

<ej-fileexplorer id="fileExplorer" path= "http://js.syncfusion.com/demos/ejServices/Content/FileBrowser/" ajaxAction="http://js.syncfusion.com/demos/ejServices/api/FileExplorer/FileOperations" (resizeStart)="onResizeStart($event)" style="display:block">

{% endhighlight %}

{% highlight ts %}

export class AppComponent { constructor(){ } onResizeStart(e: any){ // Your code here }

}

{% endhighlight %}

resizeStop

{:#events:resizestop}

Fires this event when the resizing is stopped for FileExplorer.

Name Type Description
argument Object Event parameters from FileExplorer
Name Type Description
cancel boolean Set to true when the event has to be canceled, else false.
event object returns the mouse leave event args.
model object returns the FileExplorer model.
type string returns the name of the event.

Example

{% highlight html %}

<ej-fileexplorer id="fileExplorer" path= "http://js.syncfusion.com/demos/ejServices/Content/FileBrowser/" ajaxAction="http://js.syncfusion.com/demos/ejServices/api/FileExplorer/FileOperations" (resizeStop)="onResizeStop($event)" style="display:block">

{% endhighlight %}

{% highlight ts %}

export class AppComponent { constructor(){ } onResizeStop(e: any){ // Your code here }

}

{% endhighlight %}

select

{:#events:select}

Fires when the items from grid view or tile view of FileExplorer control is selected.

Name Type Description
argument Object Event parameters from FileExplorer
Name Type Description
cancel boolean Set to true when the event has to be canceled, else false.
model object returns the FileExplorer model.
name string[] returns the name of selected items.
path string returns the path of selected items.
names string[] returns the name of selected items.
selectedItems object returns the selected item details
type string returns the name of the event.

Example

{% highlight html %}

<ej-fileexplorer id="fileExplorer" path= "http://js.syncfusion.com/demos/ejServices/Content/FileBrowser/" ajaxAction="http://js.syncfusion.com/demos/ejServices/api/FileExplorer/FileOperations" (select)="onSelect($event)" style="display:block">

{% endhighlight %}

{% highlight ts %}

export class AppComponent { constructor(){ } onSelect(e: any){ // Your code here }

}

{% endhighlight %}

templateRefresh

{:#events:templaterefresh}

Triggered when refresh the template column elements in the grid view of FileExplorer control.

Name Type Description
argument Object Event parameters from FileExplorer
Name Type Description
cancel boolean Set to true when the event has to be canceled, else false.
cell object Returns the cell object.
column object Returns the column object.
data object Returns the current row data.
model object Returns the grid model of FileExplorer.
rowIndex number Returns the current row index.
type string returns the name of the event.

Example

{% highlight html %}

<ej-fileexplorer id="fileExplorer" path= "http://js.syncfusion.com/demos/ejServices/Content/FileBrowser/" ajaxAction="http://js.syncfusion.com/demos/ejServices/api/FileExplorer/FileOperations" (templateRefresh)="onTemplateRefresh($event)" style="display:block">

{% endhighlight %}

{% highlight ts %}

export class AppComponent { constructor(){ } onTemplateRefresh(e: any){ // Your code here }

}

{% endhighlight %}

unselect

{:#events:unselect}

Fires when the items from grid view or tile view or large icons view of FileExplorer control is unselected.

Name Type Description
argument Object Event parameters from FileExplorer
Name Type Description
model object Returns the FileExplorer model.
name string Returns the name of unselected item.
names string[] Returns the name of unselected items.
nodeType string Returns the type of unselected item.
path string Returns the path of unselected item.
type string Returns the name of the event.
unselectedItem object Returns the unselected item details.
unselectedItems array Returns the unselected items details.

Example

{% highlight html %}

<ej-fileexplorer id="fileExplorer" path= "http://js.syncfusion.com/demos/ejServices/Content/FileBrowser/" ajaxAction="http://js.syncfusion.com/demos/ejServices/api/FileExplorer/FileOperations" (unselect)="onUnselect($event)" style="display:block">

{% endhighlight %}

{% highlight ts %}

export class AppComponent { constructor(){ } onUnselect(e: any){ // Your code here }

}

{% endhighlight %}