关于extjs里面checkbox的问题.请大家帮忙解决下。
时间:2011-12-06
来源:互联网
JScript code
一个checkbox是这样的.然后想让点击的时候在上面一个function里面有两代不同的代码。控制一些form的显示.想让checkbox点下去的时候就显示出来.没有勾选的时候就不显示.
JScript code
我这样写了.但是在页面中点那个checkbox没有反应.不知道是哪里出了问题.还有那个if里面取值我写的是from.findField('hd).getValue.equals('1').实在是不太懂JS.请大家帮帮忙。
new Ext.form.Checkbox({ fieldLabel:'航段显示', checked:false, name:'hdxs', listeners:{check:function(checked,check){ if(check){ searchForm.getForm().findField('hd').setValue(1); }else{ searchForm.getForm().findField('hd').setValue(0); } } } }),
一个checkbox是这样的.然后想让点击的时候在上面一个function里面有两代不同的代码。控制一些form的显示.想让checkbox点下去的时候就显示出来.没有勾选的时候就不显示.
JScript code
var typeChange = function(){ var form = searchForm.getForm(); switch(form.findField('t_type').getValue()){ case 'DEP_ARR': [color=#FF0000]if[/color] form.findField('dep').enable(); form.findField('dep').getEl().up('.x-form-item').setDisplayed(true); form.findField('dep').setValue(""); form.findField('arr').enable(); form.findField('arr').getEl().up('.x-form-item').setDisplayed(true); form.findField('arr').setValue(""); form.findField('dep2').enable(); form.findField('dep2').getEl().up('.x-form-item').setDisplayed(true); form.findField('dep2').setValue(""); form.findField('arr2').enable(); form.findField('arr2').getEl().up('.x-form-item').setDisplayed(true); form.findField('arr2').setValue(""); form.findField('dep3').enable(); form.findField('dep3').getEl().up('.x-form-item').setDisplayed(true); form.findField('dep3').setValue(""); form.findField('arr3').enable(); form.findField('arr3').getEl().up('.x-form-item').setDisplayed(true); form.findField('arr3').setValue(""); form.findField('dep4').enable(); form.findField('dep4').getEl().up('.x-form-item').setDisplayed(true); form.findField('dep4').setValue(""); form.findField('arr4').enable(); form.findField('arr4').getEl().up('.x-form-item').setDisplayed(true); form.findField('arr4').setValue(""); [color=#FF0000]}else{[/color] form.findField('dep').disable(); form.findField('dep').getEl().up('.x-form-item').setDisplayed(false); form.findField('arr').disable(); form.findField('arr').getEl().up('.x-form-item').setDisplayed(false); form.findField('dep2').disable(); form.findField('dep2').getEl().up('.x-form-item').setDisplayed(false); form.findField('arr2').disable(); form.findField('arr2').getEl().up('.x-form-item').setDisplayed(false); form.findField('dep3').disable(); form.findField('dep3').getEl().up('.x-form-item').setDisplayed(false); form.findField('arr3').disable(); form.findField('arr3').getEl().up('.x-form-item').setDisplayed(false); form.findField('dep4').disable(); form.findField('dep4').getEl().up('.x-form-item').setDisplayed(false); form.findField('arr4').disable(); form.findField('arr4').getEl().up('.x-form-item').setDisplayed(false); [color=#FF0000]}[/color] form.findField('agent').disable(); form.findField('agent').getEl().up('.x-form-item').setDisplayed(false);
我这样写了.但是在页面中点那个checkbox没有反应.不知道是哪里出了问题.还有那个if里面取值我写的是from.findField('hd).getValue.equals('1').实在是不太懂JS.请大家帮帮忙。
作者: twlwqq1342 发布时间: 2011-12-06
JScript code
new Ext.form.Checkbox({ fieldLabel:'航段显示', checked:false, name:'hdxs', listeners:{check:function(checked,check){ var field = searchForm.getForm().findField('hd'); if(field) field[check ? 'hide' : 'show'](); searchForm.doLayout(); } } }),
作者: xzz0839 发布时间: 2011-12-06
引用 1 楼 xzz0839 的回复:
JScript code
new Ext.form.Checkbox({
fieldLabel:'航段显示',
checked:false,
name:'hdxs',
listeners:{check:function(checked,check){
var field = searchForm.getForm().……
JScript code
new Ext.form.Checkbox({
fieldLabel:'航段显示',
checked:false,
name:'hdxs',
listeners:{check:function(checked,check){
var field = searchForm.getForm().……
这里我不是要隐藏那个checkbox的框框...是想点击checkbox隐藏上面第二段的东西.再点击的时候又显示出来.
而且LS这个点了那个框框就隐藏了.不能通过再点击显示了.。!
作者: twlwqq1342 发布时间: 2011-12-06
new Ext.form.Checkbox({
fieldLabel:'航段显示',
checked:false,
name:'hdxs',
listeners:{"check":function(checked,check){
if(check){
searchForm.getForm().findField('hd').setValue(1);
}else{
searchForm.getForm().findField('hd').setValue(0);
}
}
}
}),
fieldLabel:'航段显示',
checked:false,
name:'hdxs',
listeners:{"check":function(checked,check){
if(check){
searchForm.getForm().findField('hd').setValue(1);
}else{
searchForm.getForm().findField('hd').setValue(0);
}
}
}
}),
作者: MuBeiBei 发布时间: 2011-12-06
恩.参考2L的意见我现在是这样写的.
new Ext.form.Checkbox({
fieldLabel:'航段显示',
checked:true,
name:'hdxs',
listeners:{check:function(checked,check){
var field = searchForm.getForm().findField('dep');
if(field)
field[check ? 'show' : 'hide']();
searchForm.doLayout();
var field = searchForm.getForm().findField('arr');
if(field)
field[check ? 'show' : 'hide']();
searchForm.doLayout();
}
}
}),
然后输入框的确不显示了.但是输入框旁边的fieldLabel还在.这个fieldLabel应该怎么隐藏呢.?
new Ext.form.Checkbox({
fieldLabel:'航段显示',
checked:true,
name:'hdxs',
listeners:{check:function(checked,check){
var field = searchForm.getForm().findField('dep');
if(field)
field[check ? 'show' : 'hide']();
searchForm.doLayout();
var field = searchForm.getForm().findField('arr');
if(field)
field[check ? 'show' : 'hide']();
searchForm.doLayout();
}
}
}),
然后输入框的确不显示了.但是输入框旁边的fieldLabel还在.这个fieldLabel应该怎么隐藏呢.?
作者: twlwqq1342 发布时间: 2011-12-06
相关阅读 更多
热门阅读
-
office 2019专业增强版最新2021版激活秘钥/序列号/激活码推荐 附激活工具
阅读:74
-
如何安装mysql8.0
阅读:31
-
Word快速设置标题样式步骤详解
阅读:28
-
20+道必知必会的Vue面试题(附答案解析)
阅读:37
-
HTML如何制作表单
阅读:22
-
百词斩可以改天数吗?当然可以,4个步骤轻松修改天数!
阅读:31
-
ET文件格式和XLS格式文件之间如何转化?
阅读:24
-
react和vue的区别及优缺点是什么
阅读:121
-
支付宝人脸识别如何关闭?
阅读:21
-
腾讯微云怎么修改照片或视频备份路径?
阅读:28