openFoldersTo(key: Number);
key. Key of the folder to open in a base dialog with repository.
The openFoldersTo method opens a folder with specified key in a base dialog with repository.
To execute the example, the HTML page must contain the MetabaseDialogBase component named metabaseDialogBase (see Example of creating the MetabaseDialogBase component), and the repository must contain a folder with the key 117. Open this folder in a base dialog with repository:
// Determine key of the folder, which must be opened in the dialog
var openToKey = 117;
// Display the dialog with the set opened folder
metabaseDialogBase.openFoldersTo(openToKey);
PP.Ui.MetabaseDialogBase.base.show.call(metabaseDialogBase);
// Determine the path to the opened folder in the dialog
var pathToRoot = metabaseDialogBase.getPathToRoot();
var path = ""; // String containing the path
for (var i in pathToRoot) {
path += "\\";
path += pathToRoot[i].getName();
};
// Refresh contents of the folder with key
metabaseDialogBase.refresh(openToKey);
// Determine the key of the opened folder in the dialog
var key = metabaseDialogBase.getParentKey();
console.log("Path to the opened folder: " + path + ", folder key: " + key);
After executing the example the folder with the 117 key opens in a base dialog with repository:
Name of the opened folder can be see the message shown in the browser console:
Path to the opened folder: \prognozplatform7\5. Regular reports, folder key: 117
See also: