dhtmlxVault API

Constructor

var vault = new dhx.Vault('vault', {
    uploader:{ 
        target:"/upload" 
    }
});

Parameters:

  • an HTML container (or the ID of an HTML container)
  • an object with configuration properties (check below)
Objects
Methods
destructor releases occupied resources
paint repaints Vault

Data Collection

add adds info about one file to the list of Vault
filter filters files in the queue by some criteria
find looks for a file by some criterion
findAll finds all files by a criterion
getId looks up the ID of a file by its index in the queue
getIndex gets the index of a file by its ID
getItem returns a file object
load loads a list of files from a file or a server
map iterates through all items of Vault
move moves files in the queue
parse loads a list of files into Vault
reduce processes each member of the array and returns a single output value
remove removes one or several files from the queue
removeAll removes all the files in the queue
serialize serializes Vault data into an array of JSON objects
sort sorts files in the queue
update updates info of a file in the queue

Events Bus

detach detaches a handler from an event (which was attached before by the on() method)
fire triggers an inner event
on attaches a handler to an inner event of Vault

Toolbar

hide hides the toolbar
show shows the toolbar

Uploader

abort cancels upload of a file
linkDropArea links an extra area for dropping files for upload to Vault
unlinkDropArea unlinks an extra drop area from Vault
selectFile opens the dialog for selecting a new file (files) for adding to Vault
send sends a POST request for file upload to a server-side URL
Events
AfterAdd fires after a file is added to the queue
AfterDrag fires after dragging of a file in the queue is finished
AfterDrop fires before the user has finished dragging a file in the queue but after the mouse button is released
AfterRemove fires after a file is removed from the queue
BeforeAdd fires before a file is added to the queue
BeforeDrag fires before dragging of a file in the queue has started
BeforeDrop fires before the user has finished dragging a file in the queue and released the mouse button
BeforeRemove fires before a file is removed from the queue
BeforeUploadFile fires before the file upload begins
Cancel fires after the upload is canceled
CancelDrop fires on moving a mouse pointer out of file's borders while dragging the file in the queue
CanDrop fires when a dragged file is over a target file in the queue
Change fires after an operation on a file
Click fires on clicking a file in the queue
DoubleClick fires on double clicking a file in the queue
DragIn fires when a file is dragged to another potential target in the queue
DragOut fires when a file is dragged out of a potential target in the queue
DragStart fires when dragging of a file in the queue has started
FocusChange fires on moving focus to a new file in the queue
ItemMouseOver fires on moving the mouse pointer over a file in the queue
ItemRightClick fires on right clicking a file in the queue
Load fires after data are loaded into Vault
RemoveAll fires when all files are removed from the queue
UploadBegin fires when the file upload begins
UploadFile fires when all files are uploaded
UploadFail fires if the file upload failed
UploadComplete fires if the file upload is successful
UploadProgress fires on each percent of files uploading
Properties
disablePreview defines whether the preview images for the newly added files should be hidden
downloadURL sets the path for a file download
editable defines whether inline editing is enabled in the vault
eventHandlers adds event handlers to HTML elements of a custom template of Vault items
mode sets the mode of rendering the list of files
modeControls defines whether the mode controls are displayed in the toolbar of Vault
scaleFactor the multiplier factor of the quality of an HTML canvas image
progressBar a template for rendering a progress bar
templates specifies templates for the list and grid modes and the progressBar configuration
toolbar defines whether the toolbar of dhtmlxVault is shown
uploader specifies the configuration of the Uploader object

Uploader

autosend enables/disables automatic sending of an added file
fieldName sets the file field name in the form data that is sent to the server
headerParams provides additional parameters for Request Headers
params adds extra parameters for sending an XMLHttpRequest
singleRequest defines whether files are sent in one request
target sets an URL to the server-side script that will process file upload
updateFromResponse updates file attributes with data from server response
Back to top