- Home
- Forum
- JavaScript - EJ 2
- Selecting Item in FileManager with JavaScript
Selecting Item in FileManager with JavaScript
We are using your FileManager component as part of an editor and wish to reselect an item in your component via javaScript onload. I have looked through the documentation and have not found a way to do this. Any help would be greatly appreciated.
|
function fileLoad(args) {
var array = ['Documents', 'Pictures'];
fileObject.selectedItems = array;
} |
I saw your example and it is almost what I am looking for. I need to be able to select a singular file located in any depth of subfolder. There could be multiple instances of a file in multiple folders. I need to accomplish something like this:
var array = ['Pictures/Christmas.jpg'];
That example above doesn't work. And if I simply say:
var array = ['Christmas.jpg'];
It will select every item that is named Christmas.jpg.
How can I specify a file path for a single item and have it be selected? Thank you!
|
function fileLoad(args) {
//Compare the required path.
if (args.fileDetails.filterPath == '\\Pictures\\Food\\') {
//Pass the corresponding file name.
var array = ['Apple pie.png'];
fileObject.selectedItems = array;
}
} |
- 3 Replies
- 2 Participants
-
MS Michael Smith
- Nov 24, 2021 02:32 PM UTC
- Dec 8, 2021 10:49 AM UTC