Button.js 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. MWF.xDesktop.requireApp("process.Xform", "$Module", null, false);
  2. /** @class Button 按钮组件。
  3. * @example
  4. * //可以在脚本中获取该组件
  5. * //方法1:
  6. * var attachment = this.form.get("name"); //获取组件
  7. * //方法2
  8. * var attachment = this.target; //在组件事件脚本中获取
  9. * @extends MWF.xApplication.process.Xform.$Module
  10. * @hideconstructor
  11. */
  12. MWF.xApplication.process.Xform.Button = MWF.APPButton = new Class({
  13. Implements: [Events],
  14. Extends: MWF.APP$Module,
  15. iconStyle: "personfieldIcon",
  16. _loadUserInterface: function(){
  17. // var button = new Element("button");
  18. // button.inject(this.node, "after");
  19. // this.node.destroy();
  20. // this.node = button;
  21. var button = this.node.getElement("button");
  22. if (!button) button = new Element("button");
  23. button.inject(this.node, "after");
  24. this.node.destroy();
  25. this.node = button;
  26. this.node.set({
  27. "id": this.json.id,
  28. "text": this.json.name || this.json.id,
  29. "MWFType": this.json.type
  30. });
  31. if (!this.json.preprocessing) this.node.setStyles(this.form.css.buttonStyles);
  32. }
  33. });