lussoon 2010-07-29 13:31
浏览 234
已采纳

extjs写的一个简单的小例子,为什么不报错,也不调用action呢。

Ext.onReady(function(){ //使用表单提示 Ext.QuickTips.init(); Ext.form.Field.prototype.msgTarget = "side"; //定义一个输入表单 var simple = new Ext.FormPanel({ labelWidth:40, baseCls:"x-plain", defaultType:"textfield", defaults:{width:180}, items:[{ fieldLabel:"帐号", name:"user.username", allowBlank:false, blankText:"帐号不能为空" },{ inputType:"password", fieldLabel:"密码", name:"user.password", allowBlank:false, blankText:"密码不能为空" }], buttons:[{ text:"提交", type:"submit", handler:function(){ if(simple.form.isValid()){ Ext.MessageBox.show({ title:"请稍等", msg:"正在加载.....", progressText:"", width:300, progress:true, closable:false, animEl:"loding" }); var f = function(v) { return function(){ var i = v / 11; Ext.MessageBox.updateProgress(i, ''); } } for(var i = 1; i < 13; i++) { setTimeout(f(i), i * 150); } //提交到服务器操作 simple.form.doAction("submit",{ url:"http://localhost:8080/extjs/Login.action", method:"post", params:"", success:function(form, action){ document.location='user/index.jsp'; Ext.Msg.alert("登录成功!",action.result.message); }, failure:function(form, action){ Ext.Msg.alert('登陆失败', action.result.message); } }); } } },{ text:"重置", handler:function(){ //重置表单 simple.form.reset(); } }] }); //定义窗体 var _window = new Ext.Window({ title:"登录窗口", layout:"fit", width:280, height:150, plain:true, bodyStyle:"padding:10px;", maximizable:false, closeAction:"close", closable:false, collapsible:true, plain:true, buttonAlign:"center", items:simple }); _window.show(); });
  • 写回答

3条回答 默认 最新

  • works001 2010-07-29 15:06
    关注

    xml文件咋写的

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?

悬赏问题

  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 对于相关问题的求解与代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 信号傅里叶变换在matlab上遇到的小问题请求帮助
  • ¥15 保护模式-系统加载-段寄存器
  • ¥15 电脑桌面设定一个区域禁止鼠标操作
  • ¥15 求NPF226060磁芯的详细资料