-
27 May 2008 10:12 AM #1
How to hook up in checkbox on click event?
How to hook up in checkbox on click event?
Hi guys,
I'm trying to hook up a function in a checkbox's onclick event, but I can only see an event named "check".
This won't work:
I don't want the 'check' event, but the clicky one.PHP Code:{
xtype: 'xcheckbox',
fieldLabel: 'My checkbox:',
name: 'checky1',
listeners: {
'click': function(){
Ext.Msg.alert('Checkbox', 'Hi!');
}
}
}
Any ideas?
-
27 May 2008 11:01 AM #2Sencha - Community Support Team
- Join Date
- Mar 2007
- Location
- Frederick MD, NYC, DC
- Posts
- 16,167
- Vote Rating
- 29
try check not click

Jay Garcia @ModusJesus || Modus Create co-founder
Ext JS in Action author
Sencha Touch in Action author
Get in touch for Ext JS & Sencha Touch Touch Training
We are also working on Video-based Sencha Touch training: Check it out here.
-
28 May 2008 9:50 AM #3
Thanks for your effort, but as I said:
I don't want the 'check' event, but the clicky one.
Any ideas?
-
1 Aug 2008 3:47 AM #4
for me the event check works perfectly
-
1 Aug 2008 3:54 AM #5
check event on checkbox
check event on checkbox
i've tried check event on checkbox, yes its work when i click on the checkbox's label but it doesnt work when i click in the box unless i use focus event.
-
1 Aug 2008 5:22 AM #6
Code that might help
Code that might help
This code might help
In case that you want to add just to a particular form.PHP Code:var a = Ext.query('input.x-form-checkbox');
Ext.each(a, function(item) {
Ext.get(item).on('click', function(){alert(1)});
});
Me puedes constestar en espaPHP Code:this.theForm.el.on('click',function(e){
alert(e.getTarget().id);
}, this, {delegate:'input.x-form-checkbox'});
Last edited by boriscy; 1 Aug 2008 at 5:32 AM. Reason: Adding language


Reply With Quote
gmail.com