ext 怎样手动设置combox的editable属性?

千叶玫瑰 2011-07-24 02:44:07
目的就是点击check来动态设置combox的editable
var chiForm
var chiStudentFormPanel = function() {//非标准panel/**$$$$$ */
chiForm=this;
this.sglrTextField = {//手工录入
xtype : 'checkbox',
//xtype : 'textfield',
width : Height1,
fieldLabel : "手工录入",
labelAlign :'right' ,
checked :false,
listeners:{
check:function(checkbo,checked ){
if(checked){
chiForm.getForm().findField('gzmc').getEl().dom.editable = true;
Ext.getCmp('hahe').dom.editable = true;
Ext.get('gzmc').dom.editable = true;
document.getElementsByName('gzmc').editable=true;
//Ext.Msg.alert("信息","true");
}else{
chiForm.getForm().findField('gzmc').getEl().dom.editable = false;
//Ext.Msg.alert("信息","false");
}
}
},
//readOnly : true,
//editable : true,
name : "sglr"
};
var mycombotree;
this.gzmcTextField = {
xtype: 'combo',
id:'hahe',
fieldLabel: '故障明细',//'故障名称'
name: 'gzmct',
store: new Ext.data.SimpleStore({fields:[],data:[[]]}),
mode: 'local',
resizable:true,
height:500,
width : Height1,
autoScroll:false,
triggerAction:'all',
tpl: '<tpl for="."><div id="treet"></div></tpl>',
displayField: 'key',
valueField: 'value',
listeners:{
expand:function(combo ){
mycombotree=this;
tree.render("treet");
tree.root.expand();
}
},
editable :true,
emptyText: '请选择...',
hiddenName:'gzmc'
};
}
...全文
211 7 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
千叶玫瑰 2011-07-27
  • 打赏
  • 举报
回复
谢了 各位
豆虫 2011-07-27
  • 打赏
  • 举报
回复
用name操作没试过 不过LZ可以看下源码 setEditable是做了什么
用firebug看其combox渲染后的dom源码 用js dom操作下看能不完成
最好还是用id
MuBeiBei 2011-07-27
  • 打赏
  • 举报
回复
Ext.get('gzmct').setEditable(true)

这样试试
千叶玫瑰 2011-07-27
  • 打赏
  • 举报
回复
试了一下3楼正确,老大如果用不用id:hhhh而用name:gzmct或者hiddenname:gzmc怎么写?
不回答一天内也结贴给分。
谢谢了
MuBeiBei 2011-07-24
  • 打赏
  • 举报
回复
Ext.getCmp('hahe').setEditable(true)
MuBeiBei 2011-07-24
  • 打赏
  • 举报
回复
Ext.getCmp('hahe').setValue(true);
豆虫 2011-07-24
  • 打赏
  • 举报
回复
check事件里 Ext.getCmp('hahe').editable = true/false不就行了么

87,996

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 JavaScript
社区管理员
  • JavaScript
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧