Iframe.js 943 B

12345678910111213141516171819202122232425262728293031323334
  1. MWF.xDesktop.requireApp("process.Xform", "$Module", null, false);
  2. /** @class Iframe HTML iframe。
  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. * @category FormComponents
  11. * @hideconstructor
  12. */
  13. MWF.xApplication.process.Xform.Iframe = MWF.APPIframe = new Class({
  14. Extends: MWF.APP$Module,
  15. _loadUserInterface: function(){
  16. this.node.empty();
  17. var src = this.json.src;
  18. if (this.json.valueType=="script"){
  19. src = this.form.Macro.exec(((this.json.script) ? this.json.script.code : ""), this);
  20. }
  21. this.iframe = new Element("iframe", {
  22. "src": src
  23. }).inject(this.node, "after");
  24. this.node.destroy();
  25. this.node = this.iframe.setStyles({
  26. "width": "100%",
  27. "border": "0"
  28. });
  29. }
  30. });