Tree.js 891 B

12345678910111213141516171819202122232425
  1. MWF.xDesktop.requireApp("process.Xform", "$Module", null, false);
  2. MWF.require("MWF.widget.Tree", null, false);
  3. MWF.xApplication.process.Xform.Tree = MWF.APPTree = new Class({
  4. Extends: MWF.APP$Module,
  5. _loadUserInterface: function(){
  6. this.node.empty();
  7. this.tree = new MWF.widget.Tree(this.node, {"style":"form"});
  8. this.tree.form = this.form;
  9. this._setTreeWidgetStyles();
  10. var treeData = this.json.data;
  11. if (this.json.dataType == "script") treeData = this.form.Macro.exec(((this.json.dataScript) ? this.json.dataScript.code : ""), this);
  12. this.tree.load(treeData);
  13. },
  14. _setTreeWidgetStyles: function(){
  15. this.tree.css.areaNode = this.json.areaNodeStyle;
  16. this.tree.css.treeItemNode = this.json.treeItemNodeStyle;
  17. this.tree.css.textDivNode = this.json.textDivNodeStyle;
  18. this.tree.css.textDivNodeSelected = this.json.textDivNodeSelectedStyle;
  19. }
  20. });