EXT提交服务器的三种方式
一、 EXT提交服务器的三种方式?
???1. EXT的form表单ajax提交(默认提交方式)?
?????? 相对单独的ajax提交来说优点在于能省略写参数数组?
?????? FormPanel
???????在Ext中FormPanel并中并不保存表单数据,其中的数据是由BasicForm保存,在提交表单的时候需要获取当前 FormPanel中的BasicForm来进行提交.??????
????? 获取FormPanel中的BasicForm对象代码如下:
?????
1. 2. 3. Ext.Ajax.request({ 4. //请求地址 5. url: 'login.do', 6. //提交参数组 7. params: { 8. LoginName:Ext.get('LoginName').dom.value, 9. LoginPassword:Ext.get('LoginPassword').dom.value 10. }, 11. //成功时回调 12. success: function(response, options) { 13. //获取响应的json字符串 14. var responseArray = Ext.util.JSON.decode(response.responseText); 15. if(responseArray.success==true){ 16. Ext.Msg.alert('恭喜','您已成功登录!'); 17. } 18. else{ 19. Ext.Msg.alert('失败','登录失败,请重新登录'); 20. } 21. } 22. }); ?
二、利用viewport布局左边区域系统菜单跳转两种方式
??? 1,使用Ext.get('centerPanel').load(url:"aaa.jsp");url为必选参数还有其他可选参数???? 请参见api文档。缺点,加入的页面js无效?
????2,使用iframe,具体
???????? Ext.get('centerPanel').dom.innerHTML='< i f r a m e? src=aaa.jsp>< / i f r a m e >';
?????? 优 点可以在载入的页面动态加载js脚本(推荐使用)
?
?