PP.Ufe.Ui.MetaTree(settings);
settings. The JSON object with the values of the component properties.
The MetaTree constructor creates an instance of the MetaTree class.
To execute the example, the HTML page must contain links to the PP.js, PP.Metabase.js, PP.Express.js, PP.Ufe.js and PP.css, PP.Metabase.css, PP.Express.css, PP.Ufe.css styles, and a resources file (for example, resources.ru.js). The <div> element with the metaTree identifier in the <body> tag. The example must be placed in the <script> tag. It is required to add calling of the createExpress() function to the "onload" event of the <body> tag. Create a metadata tree:
var metabase, eaxMdService, metaService, metaSource, metaTree; PP.ImagePath = "../build/img/"; // Path to images folder PP.ScriptPath = "../build/"; // Path to scenarios folder PP.CSSPath = "../build/"; // Path to styles files folder function createExpress() { // Create a metabase metabase = new PP.Mb.Metabase({ PPServiceUrl: "PPService.axd?action=proxy", Id: "PROGNOZPLATFORM7", UserCreds: { UserName: "user", Password: "password" } }); // Open a repository connection metabase.open(); // Create a service for working with express reports eaxMdService = new PP.Exp.EaxMdService({ Metabase: metabase }); // Open a document with the 10902 key eaxDocument = eaxMdService.editDocument(10902); // Create a container for express reports expressBox = new PP.Exp.Ui.ExpressBox({ // Set sources Source: eaxDocument, // Set the service Service: eaxMdService }); setTimeout(createMetaTree, 1000); } function createMetaTree() { // Create a service for metadata tree metaService = new PP.Ufe.MetaSrv({ Metabase: metabase, ImagePath: PP.ImagePath }); //Create a source for metadata tree metaSource = new PP.Ufe.MetaSource({ ReportOdId: eaxDocument.getOdId().id, ActiveSheetKey: eaxDocument.getActiveSheetKey(), PPService: metaService, // Set the number of tree nodes that will be loaded ChildrenReqCount: 100 }); // Set whether data is checked metaSource.setAllowHasData(True); // Enable element selection metaSource.setAllowSelection(True); // Create a metadata tree metaTree = new PP.Ufe.Ui.MetaTree({ ParentNode: document.getElementById("metaTree"), Source: metaSource, Height: 400, Width: 250 }); }
After executing the example a metadata tree is displayed on the page:
See also: