wi" />

EXT之window动态加载页面

系统 2152 0

首先看下普通的窗口:

Js代码
  1. function <wbr>newWin()<wbr>{<wbr><wbr><wbr><wbr><wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr> var <wbr>win=</wbr> new <wbr>Ext.Window({title:</wbr> "窗口" ,<wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr>width:400,<wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr>height:300,<wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr>maximizable:</wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr> true });<wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr>win.show();<wbr>}<wbr><wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr>

<wbr>这样就是一个简单的窗口,里面不含任务内容。可以让它请求一个页面:</wbr>

Js代码
  1. var <wbr>win; <wbr><wbr></wbr></wbr></wbr>
  2. function <wbr>newWin(value)<wbr>{ <wbr><wbr></wbr></wbr></wbr></wbr>
  3. <wbr><wbr><wbr><wbr></wbr></wbr></wbr></wbr> //<wbr>如果窗口存在,显示</wbr> <wbr><wbr></wbr></wbr>
  4. <wbr><wbr><wbr><wbr>win<wbr>=<wbr>Ext.getCmp(</wbr></wbr></wbr></wbr></wbr></wbr> "win" ); <wbr><wbr></wbr></wbr>
  5. <wbr><wbr><wbr><wbr></wbr></wbr></wbr></wbr> if <wbr>(win)<wbr>{ <wbr><wbr></wbr></wbr></wbr></wbr>
  6. <wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr>win.show(); <wbr><wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr>
  7. <wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr>win.load({ <wbr><wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr>
  8. <wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr>url<wbr>:<wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr> "../TeacherDispatchAction.do?method=courseDetail" , <wbr><wbr></wbr></wbr>
  9. <wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr>params<wbr>:<wbr>{ <wbr><wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr>
  10. <wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr>couId<wbr>:<wbr>value, <wbr><wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr>
  11. <wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr>subMainId<wbr>:<wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr> "tab-" <wbr>+<wbr>value<wbr>+<wbr></wbr></wbr></wbr></wbr> "-main" <wbr><wbr></wbr></wbr>
  12. <wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr>} <wbr><wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr>
  13. <wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr>}); <wbr><wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr>
  14. <wbr><wbr><wbr><wbr>}<wbr></wbr></wbr></wbr></wbr></wbr> else <wbr>{ <wbr><wbr></wbr></wbr></wbr>
  15. <wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr>win<wbr>=<wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr> new <wbr>Ext.Window({ <wbr><wbr></wbr></wbr></wbr>
  16. <wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr>title<wbr>:<wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr> "课程信息" , <wbr><wbr></wbr></wbr>
  17. <wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr>id<wbr>:<wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr> 'win' , <wbr><wbr></wbr></wbr>
  18. <wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr>width<wbr>:<wbr>400, <wbr><wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr>
  19. <wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr>height<wbr>:<wbr>300, <wbr><wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr>
  20. <wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr>maximizable<wbr>:<wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr> true , <wbr><wbr></wbr></wbr>
  21. <wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr>closable<wbr>:<wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr> true , <wbr><wbr></wbr></wbr>
  22. <wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr>closeAction<wbr>:<wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr> 'close' <wbr><wbr></wbr></wbr>
  23. <wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr>}); <wbr><wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr>
  24. <wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr>win.show(); <wbr><wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr>
  25. <wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr>win.load({ <wbr><wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr>
  26. <wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr>url<wbr>:<wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr> "../TeacherDispatchAction.do?method=courseDetail" , <wbr><wbr></wbr></wbr>
  27. <wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr>params<wbr>:<wbr>{ <wbr><wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr>
  28. <wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr>couId<wbr>:<wbr>value, <wbr><wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr>
  29. <wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr>subMainId<wbr>:<wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr> "tab-" <wbr>+<wbr>value<wbr>+<wbr></wbr></wbr></wbr></wbr> "-main" <wbr><wbr></wbr></wbr>
  30. <wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr>}, <wbr><wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr>
  31. <wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr>scripts:<wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr> true <wbr><wbr></wbr></wbr>
  32. <wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr>}); <wbr><wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr>
  33. <wbr><wbr><wbr><wbr>} <wbr><wbr></wbr></wbr></wbr></wbr></wbr></wbr>
  34. }<wbr><wbr></wbr></wbr>

<wbr></wbr>

这里的条件语句是用来作判断,我所实现的是只打开一个窗口,根据要求动态加载页面的内容。

Js代码
  1. win.load({ <wbr><wbr></wbr></wbr>
  2. <wbr><wbr><wbr><wbr><wbr>url<wbr>:<wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr> "../TeacherDispatchAction.do?method=courseDetail" , <wbr><wbr></wbr></wbr>
  3. <wbr><wbr><wbr><wbr><wbr>params<wbr>:<wbr>{ <wbr><wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr>
  4. <wbr><wbr><wbr><wbr><wbr><wbr>couId<wbr>:<wbr>value, <wbr><wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr>
  5. <wbr><wbr><wbr><wbr><wbr><wbr>subMainId<wbr>:<wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr> "tab-" <wbr>+<wbr>value<wbr>+<wbr></wbr></wbr></wbr></wbr> "-main" <wbr><wbr></wbr></wbr>
  6. <wbr><wbr><wbr><wbr><wbr>}, <wbr><wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr>
  7. <wbr><wbr><wbr><wbr><wbr>scripts:<wbr></wbr></wbr></wbr></wbr></wbr></wbr> true <wbr><wbr></wbr></wbr>
  8. <wbr><wbr><wbr><wbr>});<wbr><wbr></wbr></wbr></wbr></wbr></wbr></wbr>

这句就是用来实现加载的语句。 注意:如果请求的页面里也包含EXT组件的话, scripts: true 不能丢掉。否则就不会显示啦。

Ext.Window的属性有:

closable : true,<wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr>//是否可关闭</wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr>

closeAction : 'close'<wbr>关闭窗口是销毁窗口,为'hide'则隐藏</wbr>

maximizable : true,<wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr>//是否可最大化<br> draggable:false,//拖动<br><wbr>resizable:false //变大小</wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr>

EXT之window动态加载页面


更多文章、技术交流、商务合作、联系博主

微信扫码或搜索:z360901061

微信扫一扫加我为好友

QQ号联系: 360901061

您的支持是博主写作最大的动力,如果您喜欢我的文章,感觉我的文章对您有帮助,请用微信扫描下面二维码支持博主2元、5元、10元、20元等您想捐的金额吧,狠狠点击下面给点支持吧,站长非常感激您!手机微信长按不能支付解决办法:请将微信支付二维码保存到相册,切换到微信,然后点击微信右上角扫一扫功能,选择支付二维码完成支付。

【本文对您有帮助就好】

您的支持是博主写作最大的动力,如果您喜欢我的文章,感觉我的文章对您有帮助,请用微信扫描上面二维码支持博主2元、5元、10元、自定义金额等您想捐的金额吧,站长会非常 感谢您的哦!!!

发表我的评论
最新评论 总共0条评论