PDA

View Full Version : Checkbox in my fieldset is checked ?



osmancorp
6 Sep 2010, 1:35 AM
Hello ,

I'd like to know if my fielset to integrate checkbox is checked or not

I tried several thing but impossible to retrieve the value.


I ask the advice of an expert to guide me please.Écouter
Lire phonétiquement


small code of my element :


,items:[{
xtype:'fieldset',
defaultType: 'checkbox',
anchor:'100%',
autoHeight:true
,items:[{
boxLabel:'Sortir du mode maintenance tous les tests',
name: 'alltest',
}]
},





hobbit.Off = Ext.extend(Ext.Window, {
constructor: function(config) {

config = Ext.apply({

id:'fs2col-winoff'
,width:500
,minWidth:280
,height:320
,minHeight:180
,modal : true
,layout:'fit'
,border:false
,closable:true
,collapsible:false
,listeners : {
close : function(n) {
Ext.getCmp('fs2col-formoff').getForm().reset();
Ext.getCmp('tabpanel').activeTab.getSelectionModel().clearSelections();
this.destroy();
}
}
,title: 'Sortie du mode maintenance'
,items:{

id:'fs2col-formoff'
,xtype:'form'
,layout:'vbox'
,layoutConfig: {
align : 'stretch',
pack : 'start',
}
,frame:true
,labelWidth:50
,defaults:{
columnWidth:0.5
,layout:'form'
,hideLabels:true
,border:false
,bodyStyle:'padding:4px'
}

,items:[{
xtype:'fieldset',
defaultType: 'checkbox',
anchor:'100%',
autoHeight:true
,items:[{
boxLabel:'Sortir du mode maintenance tous les tests',
name: 'alltest',
}]
},{

defaults:{
xtype:'fieldset',
layout:'form',
anchor:'100%',
autoHeight:true
}
,items:[{

title:'Sortir seulement un test du mode maintenance'
,defaultType:'textfield'
,id : 'alltestoff'
,defaults:{anchor:'-20', allowBlank:true}
,items:[{
fieldLabel:'Nom test'

}]
}]
},{

defaults:{
xtype:'fieldset',
layout:'form',
anchor:'100%',
autoHeight:true
}
,items:[{

defaultType:'textfield'
,defaults:{anchor:'-20', allowBlank:true}
,items:[{
xtype: 'label',
text: 'Deux choix sont possibles, soit de mettre en maintenance tous les tests, soit d\'entrer le nom du test a mettre en maintenance.'
}]
}]
}],
},
buttons: [{
text: 'Valider',
handler : function() {
// Action delegate
}
},{
text: 'Annuler',
handler: function() {
Ext.getCmp('fs2col-formoff').getForm().reset();
Ext.getCmp('tabpanel').activeTab.getSelectionModel().clearSelections();
Ext.getCmp('fs2col-winoff').destroy();
}
}]



}, config);

hobbit.Off.superclass.constructor.call(this, config);

}



});

Condor
6 Sep 2010, 1:40 AM
var checked = Ext.getCmp('fs2col-formoff').getForm().findField('alltest').getValue();

osmancorp
6 Sep 2010, 1:44 AM
var checked = Ext.getCmp('fs2col-formoff').getForm().findField('alltest').getValue();


You are a killer

Thank you