EXTJS之纠结错误
Ext.onReady(function() {
var formPanel = new Ext.form.FormPanel({
baseCls: 'x-plain',
labelWidth: 55,
url: 'save-form.php',
layout: {
type: 'vbox',
align: 'stretch' // Child items are stretched to full width
},
defaults: {
xtype: 'textfield'
},
items: [{
plugins: [ Ext.ux.FieldLabeler ],
fieldLabel: 'tittle',
allowBlank:false,
blankText:"标题不能为空",
msgTarget:"side",
name: 'articleTittle'
},{
plugins: [ Ext.ux.FieldLabeler ],
fieldLabel: 'type',
name: 'articleType',
allowBlank:false,
blankText:"文章类型不能为空",
msgTarget:"side"
}, {
xtype: 'textarea',
fieldLabel: 'text',
hideLabel: true,
name: 'articleText',
flex: 1, // Take up all *remaining* vertical space
allowBlank:false,
blankText:"文章内容不能为空",
msgTarget:"side"
}]
});
var w = new Ext.Window({
title: 'Compose message',
collapsible: true,
maximizable: true,
width: 750,
height: 450,
minWidth: 300,
minHeight: 200,
layout: 'fit',
plain: true,
bodyStyle: 'padding:5px;',
buttonAlign: 'center',
items: formPanel,
buttons: [{
xtype:"button",
height:5,
text:"save",
scope:this,
handler:doSave
},{
xtype:"button",
height:5,
text:"cancel",
scope:this,
handler:reset
}]
});
function doSave(){
formPanel.getForm().submit({
clientValidation:true,
waitMsg:"正在保存数据...",
url:"rjb/textBookAction.action",//struts.xml中的namespace为"/rjb",这里不要/
method:"POST",
success:function(form,action){
Ext.Msg.alert("提示","保存成功");
},
failure:function(form,action){
Ext.Msg.alert("提示","保存失败");
}
});
}
function reset(){
formPanel.form.reset();
}
w.show();
});
action为:
public class TextBookAction extends ActionSupport{
@Override
public String execute() throws Exception {
// TODO Auto-generated method stub
System.out.println("TextBookAction...");
return super.execute();
}
}
上面这个窗口,点提交时,后天action调到了,但是为什么"waitMsg:"正在保存数据..."却一直在,关不了,"Ext.Msg.alert("提示","保存成功");"也没弹出来!
求解求解!!
"
var formPanel = new Ext.form.FormPanel({
baseCls: 'x-plain',
labelWidth: 55,
url: 'save-form.php',
layout: {
type: 'vbox',
align: 'stretch' // Child items are stretched to full width
},
defaults: {
xtype: 'textfield'
},
items: [{
plugins: [ Ext.ux.FieldLabeler ],
fieldLabel: 'tittle',
allowBlank:false,
blankText:"标题不能为空",
msgTarget:"side",
name: 'articleTittle'
},{
plugins: [ Ext.ux.FieldLabeler ],
fieldLabel: 'type',
name: 'articleType',
allowBlank:false,
blankText:"文章类型不能为空",
msgTarget:"side"
}, {
xtype: 'textarea',
fieldLabel: 'text',
hideLabel: true,
name: 'articleText',
flex: 1, // Take up all *remaining* vertical space
allowBlank:false,
blankText:"文章内容不能为空",
msgTarget:"side"
}]
});
var w = new Ext.Window({
title: 'Compose message',
collapsible: true,
maximizable: true,
width: 750,
height: 450,
minWidth: 300,
minHeight: 200,
layout: 'fit',
plain: true,
bodyStyle: 'padding:5px;',
buttonAlign: 'center',
items: formPanel,
buttons: [{
xtype:"button",
height:5,
text:"save",
scope:this,
handler:doSave
},{
xtype:"button",
height:5,
text:"cancel",
scope:this,
handler:reset
}]
});
function doSave(){
formPanel.getForm().submit({
clientValidation:true,
waitMsg:"正在保存数据...",
url:"rjb/textBookAction.action",//struts.xml中的namespace为"/rjb",这里不要/
method:"POST",
success:function(form,action){
Ext.Msg.alert("提示","保存成功");
},
failure:function(form,action){
Ext.Msg.alert("提示","保存失败");
}
});
}
function reset(){
formPanel.form.reset();
}
w.show();
});
action为:
public class TextBookAction extends ActionSupport{
@Override
public String execute() throws Exception {
// TODO Auto-generated method stub
System.out.println("TextBookAction...");
return super.execute();
}
}
上面这个窗口,点提交时,后天action调到了,但是为什么"waitMsg:"正在保存数据..."却一直在,关不了,"Ext.Msg.alert("提示","保存成功");"也没弹出来!
求解求解!!
"
...全文
相关推荐
Python django Extjs 项目开发中的错误小记
在Python Django项目开发中使用Extjs时,开发者们可能会遇到各种各样的小错误或者问题。
ExtJs6入门-使用SenchaCmd命令创建第一个ExtJs6的HelloWorld项目
这篇博客介绍了如何通过SenchaCmd工具创建第一个ExtJS6 HelloWorld项目,包括安装SenchaCmd,下载ExtJS6文件,创建项目,运行项目并在浏览器中查看结果。详细步骤适合初学者,旨在简化开发流程。
extjs中滚动条属性_ExtJs控件属性配置详细
本文详细介绍了ExtJS中多个控件的配置项,包括TimeField、FieldSet、DateField、ComboBox、RadioGroup、CheckboxGroup、TextField、TextArea等,涵盖了验证、格式、动画、布局等属性。此外,还提及了FormPanel、BasicForm及其相关Action的使用方法,以及GridPanel、EditorGridPanel的分组功能和数据处理。通过这些配置,开发者可以更灵活地定制ExtJS应用。
ExtJS的中法语千位分隔符
本文讲述了作者在某金融机构项目中遇到的一个因法文债券价格千位分隔符为空格而非逗号导致的问题,该问题在英文消息源故障时暴露,影响了交易员对债券价格异常的警报。在使用ExtJS前端框架时,也遇到了类似UI显示错误,但经过检查并未发现调用错误。
Extjs学习过程中新手容易碰到的低级错误积累
"在学习Extjs的过程中,新手可能会遇到一些常见问题,例如.msi安装文件的误解、脚本引用的顺序错误、菜单使用时的渲染问题等。本文将针对这些初级错误进行总结,帮助初学者避免这些问题,顺利进行开发工作


其他
