PDA

View Full Version : Unable to Enable checkbox on condition



shriyansp
20 Jan 2009, 10:24 PM
Hi,

Please help me on this, its an urgent for me, i am designing one page consisting of combo and checkboxes. i need to enable(checked) checkbox when i am selecting the combo value. i have written code for that but it is not reflecting. i have checked with plain html code also there it is working fine. please solve my problem,

here i am sending the code also.

var comboForm = new Ext.form.FormPanel({
frame:true,
height:250,
bodyStyle:'padding:5px 5px 0',
cls: 'left-right-buttons',
width: 980,

layout:'absolute',
title: '<b><center><font size=2>Lot Defect Summary</font></center></b>',
items:[{
x:0,
y:10,
id:'fgp',
xtype:'combo',
store: store,
typeAhead: true,
displayField:'displaystatus',
mode: 'local',
forceSelection: true,
triggerAction: 'all',
fieldLabel: 'Display Status',
name: 'fgpart',
width:100,
hideTrigger:false,
selectOnFocus:true,
anchor:'95%',
listeners:{
select: function(){
if(comboForm.findById("fgp").getValue()=="SelectAll")
{
// var hh= comboForm.findById("1").checked;
comboForm.findById('1').checked=true;
// alert(comboForm.findById("xyz").checked="true");

}

}
}


},


{x:10,y:40,id:'xyz',xtype: 'checkbox', itemCls: 'x-check-group-alt', boxLabel: 'Active', name: 'Active'},
{x:10,y:60,id:'2',xtype: 'checkbox', itemCls: 'x-check-group-alt', boxLabel: 'Prod Fixed', name: 'xyz'},
{x:10,y:80,id:'3',xtype: 'checkbox', itemCls: 'x-check-group-alt', boxLabel: 'Cancel Entry', name: 'CancelEntry'},
{x:200,y:40,id:'4',xtype: 'checkbox', itemCls: 'x-check-group-alt', boxLabel: 'QA Cfm Fixed', name: 'CfmFixed'},
{x:200,y:60,id:'5',xtype: 'checkbox', itemCls: 'x-check-group-alt', boxLabel: 'QA UAI', name: 'QAUAI'}],

buttons: [{
id: 'display',
text: '<b><font color="#25587E">Update Display Status Filter</font></b>',
align : 'left',
width:100,
formBind: true,

handler:function(){

var param1=comboForm.getForm().getValues(true).replace(/&/g,', ');
alert(param1);

}
}]

});

******************************
my comboForm consisting of one combo box, one button, 5 checkboxes. based on the combo selection checkbox should checked.

please help me.

Shriyans

carol.ext
21 Jan 2009, 10:39 AM
Please post your code in code tags (http://extjs.com/learn/Ext_Forum_Help#Advanced_mode) and use the preview button to verify that the code is nicely indented and readable.

Two of the top reasons people skip past posts and do not stop to help are "unformatted code" and "help, this is urgent".

napolennon
22 Jan 2009, 2:10 AM
this one i used to do to check a checkbox.
(is there a better way to check a checkbox?please let me know :D)



comboForm.findById('1').setValue(true);

Condor
22 Jan 2009, 2:46 AM
I'd use:

comboForm.getForm().findField('Active').setValue(true);
(I don't like ids, because they must be unique in the entire page)