PDA

View Full Version : If this radiobutton do this else this problem



Dannesart
1 Dec 2011, 6:54 AM
Hi i got two radiobuttons:

{
xtype: 'radiogroup',
width: 440,
fieldLabel: 'Typ av avslut',
items: [
{
xtype: 'radiofield',
name: 'typeOfEnding',
boxLabel: 'Slutfört uppdrag',
itemId: 'completedOrder',
checked: true
},
{
xtype: 'radiofield',
name: 'typeOfEnding',
itemId: 'lostOrder',
boxLabel: 'Tappat uppdrag'

}
]
},


defineReferences:
this.completedOrder = this.down('#completedOrder');
this.lostOrder = this.down('#lostOrder');


my button:
onSaveButtonClick: function(checkbox, checked) {
if (this.lostOrder.getValue()===1) {
var command = Ext.create('Intelliplan.Data.General.CustOrder.Command.CloseCustOrder');
var params = {
custOrderNo: this.custOrderNo
}
// command.execute(params, function(){
//
// }, this)
console.log(this.onLostOrderChecked(checked));
alert('avslutat')
}
else {
alert('tappat')
}

// this.close();
},
I wanted to if lostOrder is checked the button click should alert something
and if completedOrder is checked the button click should alert something else.
Thank you

tobiu
1 Dec 2011, 7:13 AM
well, i have no clue in which scope you define the references, so i would at first make sure they are in the same scope as the button handler.

i would also add a inputValue config to the radios and get the groudValue of one of them.