Hello,
I’m trying to use the filemanager widget in a jet app, with a proxy to intercept all ajax calls made by the filemanager to load and update data on the server.
After many, many trials and errors, I came up with the following code, which seems to work, in the sense that the filemanager calls the proxy when loading data and when something change (ex: new folder, rename folder …).
The problem is: for loading the data, filemanager calls the “load” member function of the proxy. For changing the date (new folder, rename folder), I was expecting the filemanager to call the “save” method of the proxy, which exists. Instead it calls the “load” method.
Is this a correct behaviour ? Reading the docs it should not be like this.
Thank you everybody for any help
Regards
Antonio
THE CODE:
export default class DataView extends JetView{
config(){
// Get the theme in use
const theme = this.app.config.theme;
// Access to the "locale plugin service
const _ = this.app.getService("locale")._;
return {
view:"filemanager",
id: "admin:files",
autoConfig:true,
css: theme,
// The url will be used to load data when the filemanager is initialized
// We don't specify a url but use a proxy object. The load method of the proxy will be called.
url: fileSystemProxy,
// We use a proxy also to update data on the server.
handlers:{
upload: fileSystemProxy,
download: fileSystemProxy,
copy: fileSystemProxy,
move: fileSystemProxy,
remove: fileSystemProxy,
rename: fileSystemProxy,
create: fileSystemProxy,
branch: fileSystemProxy, // for dynamic loading in the "branch" mode
files: fileSystemProxy, // for dynamic loading in the "files" mode
search: fileSystemProxy // for server-side searching for a file
}
}
}