Iframe.js 986 B

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