87,989
社区成员
发帖
与我相关
我的任务
分享
for(i=0;i<r.length;i++){
var name=r[i].value;
var label=r[i].display;
ifnames.push(label);
ipaddrlist = new Ext.Panel({
autoHeight:true,
width:600,
///height:70,
labelWidth:50,
items:[{
layout:'column',
width:500,
items:[{
columnWidth:.2,
layout: 'column',
items: [
new Ext.form.Checkbox({
id:label,
style:'margin-left:25px',
name:name,
listeners:{
check:function(){
}
}
}),{
width:33,items:[{xtype:'label',text:label}]
}
]
},{
columnWidth:.8,
layout: 'form',
items: [
new Ext.form.TextField({
id:label+'ip',
width:130,
fieldLabel : "<span style='margin-left:10px'>虚拟IP地址</span>",
name:name
})
]
}]
}]
});
Ext.getCmp('ip_addr').items.add(ipaddrlist);
other.doLayout(true);
}
for(i=0;i<ifnames.length;i++){
var swit=Ext.getCmp(ifnames[i]).getValue();
var ipaddr=Ext.getCmp(ifnames[i]+'ip').getValue();
Ext.get(ifnames[i]).on('click',function(){
if(swit==true){
// Ext.getCmp(ifnames[i]+'ip').disable(true);
}else if(swit==false){
// Ext.getCmp(ifnames[i]+'ip').enable(true);
}
})
for(j=0;j<net.length;j++){
if(net[j]==ifnames[i]){
Ext.getCmp(ifnames[i]).setValue(true);
Ext.getCmp(ifnames[i]+'ip').setValue(vitual[j]);
}
}
}
Ext.getCmp('组件id').on('check',function(item,check){
//item是当前checkbox check监听的是状态 true/false
})
Ext.get(ifnames[i]).on('check',function(){
if(swit==true){
// Ext.getCmp(ifnames[i]+'ip').disable(true);
}else if(swit==false){
// Ext.getCmp(ifnames[i]+'ip').enable(true);
}
})
ipaddrlist = new Ext.Panel({
autoHeight:true,
width:600,
///height:70,
labelWidth:50,
items:[{
layout:'column',
width:500,
items:[{
columnWidth:.2,
layout: 'column',
items: [
new Ext.form.Checkbox({
id:label,
style:'margin-left:25px',
name:name,
listeners:{
check:function(){
//开始是写在这里的,但是获取不到下面的文本框对象,所以没办法在这里控制文本框的disable
}
}
}),{
width:33,items:[{xtype:'label',text:label}]
}
]
},{
columnWidth:.8,
layout: 'form',
items: [
new Ext.form.TextField({
id:label+'ip',
width:130,
fieldLabel : "<span style='margin-left:10px'>虚拟IP地址</span>",
name:name
})
]
}]
}]
});
Ext.get(ifnames[i]).on('click',function(){
if(swit==true){
// Ext.getCmp(ifnames[i]+'ip').disable(true);
}else if(swit==false){
// Ext.getCmp(ifnames[i]+'ip').enable(true);
}
})