FilesView
The FilesView control is used to manage and display document files.
The FilesView inherits all the methods and properties from the base class View.
Constructor:
constructor(parent: View)
Creates an instance of FilesView control.parent: the View containing the control itself.
Properties:
source: Record | DocumentFiles | DocumentFile[] | RecordsView
The source from which files are loaded into the view. This could be a record, an array of files, or a RecordView instance (it will display files of currently focused document).focused: DocumentFile | Version
Represents the currently focused file or version in the control. A Version object can be selected only if options.versions is set to true.selected: DocumentFile[]
Returns currently selected files.options: FilesViewOptions
Contains the configuration options for the file the control. See FilesViewOptions.select(handler: (e: FilesViewSelectEvent)=> any)
Registers a handler function that is called when a file is selected. Usee.fileproperty to access selected file object.-
contextMenu(handler: (e: ViewMouseEvent)=> Command[]):
Just like in the base classView, it listens control’s right mouse click events. Unlike the base class, FilesView already has some built-in context menu commands (see FilesViewOptions). Also, you can defineget fileCommamnds()property in your document class script to additionally extend FilesView context menu.Hint
SYS$DATA document class has a good example of
get fileCommamnds()script, which adds commands to add files from the file system and from scanner.drop(handler: (e: ViewDropEvent)=> any)
Registers a handler function that is called when a file is dragged & dropped to FilesView control. Usee.fileswill contain list of files being dropped. Propertye.ctrlindicates ifCtrlkey is pressed on the keyboard during drag & drop.