Hi,
Changing the locale to set a different root name is a dirty fix indeed I think it is better to set the name of the root in Backend.getRootName()
. You can redefine the method to return anything else (a string):
getRootName() {
const _ = this.app.getService("locale")._;
//return _("My Files");
return _("live"); // also do not forget to add this string to locales if you need localization; if not, you can simply return "live" here
}
Hence this very method can be used to return the name of the root folder: $$("files").getService("backend").getRootName()
. To refresh FM, you can call $$("files").$app.refresh()
.
endpoint
in your question suggests that you want to fetch the name of the root from the backend, am I right? If I am, you can redefine getRootName
to send requests, but then you would return a promise from this method and will have to redefine code that calls getRootName
(because that code expects it to return a string synchronously). I guess you can also cache the root name so as not to send requests every time a view with that panel is repainted.