EXT JS 表单
来源:互联网 发布:python运行 编辑:程序博客网 时间:2024/05/16 15:17
先来一个简单的表单文件上传:
var fm = new Ext.FormPanel({autoScroll:true,applyTo: 'form',height: 215,width: 480,frame:false,fileUpload: true, //上传文件defaultType:'textfield',labelWidth:120, //在formPanel面板上添加组件 items:[{xtype:'field',fieldLabel:'请选择要上传的文件 ',width:300,allowBlank:false,inputType:'file',name:'file'}]});
使用按钮来触发上传事件:
//EXT的默认form表单提交(ajax)
function upload() { //第一个参数可以为submit或load fm.form.doAction("submit",{ url : 'upload.action?t=' + new Date(), //如果有表单以外的参数,则使用params: waitTitle : '提示', method : 'POST', waitMsg : '正在上传,请稍候...', success : function(form, action) { // 回调函数有2个参数,第一个是传入该表单,第二个是从服务器传回来的JSON Ext.MessageBox.alert('提示', '上传成功'); }, failure : function(form, action) { Ext.MessageBox.alert('提示', '上传失败'); } }); }
EXT的ajax请求:
Ext.Ajax.request({url: 'upload.do?t=' + new Date(),method: 'post',//处理ajax的返回数据success: function(response, options){status = response.responseText;var obj = Ext.util.JSON.decode(response.responseText);if(obj.success!=false){if(obj.finished){}else{}}},failure: function(){Ext.Msg.alert('错误', '发生错误了。');} });
- EXT JS 表单
- ext js Form 交互式表单
- EXT JS fORM 交互式表单
- Ext Js Form表单(四)
- run Ext JS Form 交互式表单
- Ext js Form 交互式表单 initEditor:
- EXT表单
- Ext 表单
- EXT表单
- ext js 控件显示隐藏/与表单布局
- Ext-JS表单提交初探(用户注册)
- Ext Js 3.2 form表单布局的小例子
- Ext.js各种表单类型的集合(35)
- Ext.js表单—Vbox布局(46)
- Ext.js 古怪的问题(表单布局崩溃)
- Ext Js
- Ext.js
- ext js
- IOS-AVAudioPlayer文档翻译
- python 无法提交,出现no username supplied (see "hg help config")?
- java学习笔记8 - maven profile实现多环境打包
- 字节数组 与 十六进制间的转换
- 生活
- EXT JS 表单
- iOS开发那些事--编写OCUnit测试方法-逻辑测试方法
- JDBC连接各种数据库方法
- oracle rowid
- Js Quiz
- 易语言中的数据类型
- java4android 操作字符串
- 学习Struts2 jQuery Plugin 3.0
- Linux查看文件夹大小的命令