Skip to main content

setValue()

sets the value for a SimpleVault control

setValue(value: object[]): void;

Parameters:

  • value: array - the value to be set

Example

form.getItem("simpleVault").setValue([
{
"id": "file_id",
"name": "file_name.png",
"status": "uploaded",
}
]);

The value array can contain a set of files to load. Each file object can contain the following properties:

  • id - (string|number) optional, the id of the file
  • file - (object) optional, the File object, in case of loading to the server the property is obligatory
  • status - (string) optional, the status of the file ("queue", "inprogress", "uploaded", or "failed")
  • progress - (number) the progress of the file upload
  • request - (object) optional, an XMLHttpRequest object sent to the server when an upload begins
  • name - (string) optional, the name of the file including the extension (for adding files from the server)
  • path - (string) optional, the path to the file on the computer starting from the name of the folder (in case a folder with files is added)
  • [key:string] - optional, any key:value pair received as a server response (if the updateFromResponse property is enabled)