setAttrsTreeOptions (wbkDocument, rubKey, xmlStr, callback);
wbkDocument. Sets workbook document.
rubKey. Sets time series database key.
xmlStr. Sets XML string that contains settings.
callback. Sets operation completion handler.
The setAttrsTreeOptions method is used to set up attributes in hierarchy of workbook series.
To execute the example, the page must contain the WorkbookBox component named workbookBox (see Example of Creating the WorkbookBox Component), and also add the following code in the handler, that processes document opening event:
var setAttrsTreeOptionsButt = new PP.Ui.Button({ ParentNode: document.body, //DOM parent node Content: "Set Initial Set of Attributes", //text Click: PP.Delegate(onClickSetAttrsTreeOptions) }); function onClickSetAttrsTreeOptions() { //Get time series database key var rubKey = wbk.getActiveSheet().getRub().meta.obInst.obDesc.k; var xmlStr = "<Breadcrumb></Breadcrumb>"; //Determine attribute settings in workbook series hierarchy tsService.setAttrsTreeOptions(wbk, rubKey, xmlStr); //Determine settings of displaying breadcrumb links var options = workbookBox.getDataView().getBreadcrumb().getOptions(); options = null; options = new PP.TS.MetaAttrBrCrOptionParser({ XML: xmlStr //XML string for parsing }); workbookBox.getDataView().getBreadcrumb().setOptions(options); workbookBox.getDataView().getBreadcrumb().refreshAll(); }
After executing the example the button Define Initial Attributes Set is placed in the HTML page. Clicking this button sets breadcrumb chain items in accordance with XML string.
See also: