如题
下面是页面的<!-- LIBS -->
<script type="text/javascript" src="../ext-3.3.1/adapter/ext/ext-base.js"></script>
<!-- ENDLIBS -->
<script type="text/javascript" src="../ext-3.3.1/ext-all-debug.js"></script>下面是JS里面的代码:MyDesktop.GridWindow = Ext.extend(Ext.app.Module, {
id: 'grid-win',
init: function () {
this.launcher = {
text: 'Grid Window',
iconCls: 'icon-grid',
handler: this.createWindow,
scope: this
}
},
createWindow: function () {
var desktop = this.app.getDesktop();
var win = desktop.getWindow('grid-win');
var aaa = new Ext.form.FieldSet({
xtype: 'form',
id: 'form-widgets',
title: 'Form Widgets',
width: 630,
height: 700,
frame: true,
x: 50, y: 260,
bodyStyle: {
padding: '10px 20px'
},
defaults: {
anchor: '98%',
msgTarget: 'side',
allowBlank: false
},
items: [{
xtype: 'label',
text: 'Plain Label'
}, {
fieldLabel: 'TextField',
xtype: 'textfield',
emptyText: 'Enter a value',
itemCls: 'x-form-required'
}, {
fieldLabel: 'ComboBox',
xtype: 'combo',
store: ['Foo', 'Bar'],
itemCls: 'x-form-required',
resizable: true
}, {
fieldLabel: 'DateField',
itemCls: 'x-form-required',
xtype: 'datefield'
}, {
fieldLabel: 'TimeField',
itemCls: 'x-form-required',
xtype: 'timefield'
}, {
fieldLabel: 'NumberField',
emptyText: '(This field is optional)',
allowBlank: true,
xtype: 'numberfield'
}],
buttons: [{
text: '重置',
cls: 'x-icon-btn',
iconCls: 'x-icon-btn-reset',
handler: function () {
alert(aaa.id);
// aaa.form.reset(); //重置form
// aaa.getForm().getEl().dom.reset(); //重置form
Ext.getCmp('aaa').form.reset();
}
}]
});
if (!win) {
win = desktop.createWindow({
width: 715, height: 300, plain: true, resizable: false, modal: true, layout: 'fit', xtype: 'form',
id: 'grid-win',
title: 'Grid Window',
iconCls: 'icon-grid',
items: [aaa]
});
}
win.show();
}
});所有该试的发病高发都写了就是不管用 帮忙啊
下面是页面的<!-- LIBS -->
<script type="text/javascript" src="../ext-3.3.1/adapter/ext/ext-base.js"></script>
<!-- ENDLIBS -->
<script type="text/javascript" src="../ext-3.3.1/ext-all-debug.js"></script>下面是JS里面的代码:MyDesktop.GridWindow = Ext.extend(Ext.app.Module, {
id: 'grid-win',
init: function () {
this.launcher = {
text: 'Grid Window',
iconCls: 'icon-grid',
handler: this.createWindow,
scope: this
}
},
createWindow: function () {
var desktop = this.app.getDesktop();
var win = desktop.getWindow('grid-win');
var aaa = new Ext.form.FieldSet({
xtype: 'form',
id: 'form-widgets',
title: 'Form Widgets',
width: 630,
height: 700,
frame: true,
x: 50, y: 260,
bodyStyle: {
padding: '10px 20px'
},
defaults: {
anchor: '98%',
msgTarget: 'side',
allowBlank: false
},
items: [{
xtype: 'label',
text: 'Plain Label'
}, {
fieldLabel: 'TextField',
xtype: 'textfield',
emptyText: 'Enter a value',
itemCls: 'x-form-required'
}, {
fieldLabel: 'ComboBox',
xtype: 'combo',
store: ['Foo', 'Bar'],
itemCls: 'x-form-required',
resizable: true
}, {
fieldLabel: 'DateField',
itemCls: 'x-form-required',
xtype: 'datefield'
}, {
fieldLabel: 'TimeField',
itemCls: 'x-form-required',
xtype: 'timefield'
}, {
fieldLabel: 'NumberField',
emptyText: '(This field is optional)',
allowBlank: true,
xtype: 'numberfield'
}],
buttons: [{
text: '重置',
cls: 'x-icon-btn',
iconCls: 'x-icon-btn-reset',
handler: function () {
alert(aaa.id);
// aaa.form.reset(); //重置form
// aaa.getForm().getEl().dom.reset(); //重置form
Ext.getCmp('aaa').form.reset();
}
}]
});
if (!win) {
win = desktop.createWindow({
width: 715, height: 300, plain: true, resizable: false, modal: true, layout: 'fit', xtype: 'form',
id: 'grid-win',
title: 'Grid Window',
iconCls: 'icon-grid',
items: [aaa]
});
}
win.show();
}
});所有该试的发病高发都写了就是不管用 帮忙啊
解决方案 »
- 从数据库取出来的东西动态的添加到select下拉框中
- spring 问题:大虾们,帮忙给看一下...
- 一个骨灰级菜鸟型问题
- 用Spring JdbcTemplate的queryForList查询要比直接用Connection慢好多呀!
- 能帮忙列几个在上海的不错的公司吗
- jdbc连接问题???
- 请问:在哪里可以下载到开源的基于J2EE的权限管理模块??
- hibernate如何更新主键值?
- 真郁闷:TOMCAT配置出现这样的问题:可以打开HTM文件,但是一碰到JSP就报错(100分奉上解决者,分已经给出,别处结贴)
- EJB有而SERVLET和JAVABEAN没有的特性是什么?在什么情况下可以不用EJB而用后面两者来代替呢?
- 关于apache httpclient使用https协议连接
- C# 转java 难么。
Microsoft JScript 运行时错误: 'Ext.getCmp(...)' 为空或不是对象
一直这2个错误
而是Ext.getCmp('form-widgets').form.reset();,getCmp("这里面是元素的id,比如form的id,或者form里面的某一个标签的id")
我给'TextField'设置了个ID就能重置了 问题是我要20多个'TextField' 不可能要20个ID吧 很麻烦啊
不用谢,创建form不应该是new Ext.FormPanel啊?Ext.form.FieldSet好像是创建表单字段的,不能清空是不是因为创建FormPanel出错了。只是猜测
我也有这样的问题,
//_movieForm.getForm().reset();
//_movieForm.form.reset();
_movieForm.getForm().getEl().dom.reset();三种方法就只有最后一种有效果,但是我Form里面有个隐藏的ID,
重置的时候ID还在,有什么解决的办法吗?
修改 清空 删除 当点清空时把表单清空,将第一个按钮设置成 添加 ....
然后根据id来判断是做修改还是添加..
可以id没有清空,一直在怎么解决啊?