PDA

View Full Version : Checkbox blur and focus events not firing



stingrae
11 Sep 2008, 2:29 AM
Hi all

In my app, i have 8 checkboxs. The form is designed to be usable with only the keyboard, and i was using the on('blur') event of the last checkbox to tell when a user had tabbed through that specific section of the form. I need this as the next control to be focused on after the last checkbox is tabbed off of is determined by the values set in the checkbox section.
(i can post code if this is unclear)

In Ext2.2 it seems the blur event is no longer fired. Is there any way to re-enable this event? I've tried resumeEvents() to no avail.
As far as i can tell the only event fired by checkboxes in 2.2 is the 'check' event.

Any help would be greatly appreciated.

Thanks!

TopKatz
11 Sep 2008, 3:36 AM
"checked" is the only event on the checkbox now. Not really sure why, but I had problems with it as well on a dynamic form. My events would fire every time I loaded the form with data, and the boxs were set. My work around was to take off the handler before I loaded the form, then put them back on after the data was in.

Condor
11 Sep 2008, 3:45 AM
I haven't checked, but my proposed fix (http://extjs.com/forum/showthread.php?t=44603) for other Checkbox problems might also help with this.

stingrae
15 Sep 2008, 1:02 AM
Thanks!

I'll give it a try.

stingrae
15 Sep 2008, 7:09 AM
Condor

Your proposed fix does indeed work (events now firing).
But it does cause the checkbox to render incorrectly, it now shows 2 boxes along side one another.

Still, i think i can work around that with some css, thanks for the help.

Condor
15 Sep 2008, 9:30 AM
That shouldn't happen. You probably have some custom CSS rules that cause the original checkbox to be visible again.

narendrak
26 Nov 2009, 3:20 AM
I have not used any custom rules, but still i am getting the same error mentioned by stingrae.

listeners: {
expand: function(){ //function of accordion in which my checkbox is present.
Ext.MessageBox.alert('CheckBox Test' ,testCheckBox,function(btn,text){
if(btn == 'ok')
{
testCheckBox.focus(true,100);
}
});
}