Iframe.js 970 B

1234567891011121314151617181920212223242526272829303132333435
  1. MWF.xDesktop.requireApp("process.Xform", "$Module", null, false);
  2. /** @class Iframe HTML iframe。
  3. * @example
  4. * //可以在脚本中获取该组件
  5. * //方法1:
  6. * var iframe = this.form.get("name"); //获取组件
  7. * //方法2
  8. * var iframe = this.target; //在组件事件脚本中获取
  9. * @extends MWF.xApplication.process.Xform.$Module
  10. * @o2category FormComponents
  11. * @o2range {Process|CMS|Portal}
  12. * @hideconstructor
  13. */
  14. MWF.xApplication.process.Xform.Iframe = MWF.APPIframe = new Class({
  15. Extends: MWF.APP$Module,
  16. _loadUserInterface: function(){
  17. this.node.empty();
  18. var src = this.json.src;
  19. if (this.json.valueType=="script"){
  20. src = this.form.Macro.exec(((this.json.script) ? this.json.script.code : ""), this);
  21. }
  22. this.iframe = new Element("iframe", {
  23. "src": src
  24. }).inject(this.node, "after");
  25. this.node.destroy();
  26. this.node = this.iframe.setStyles({
  27. "width": "100%",
  28. "border": "0"
  29. });
  30. }
  31. });