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: (f: DocumentFile) => any)
Registers a handler function that is called when a file is selected.-
contextMenu(handler: ()=> 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 (seeFilesViewOptions
). 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.