PDA

View Full Version : Radiofield Event not Triggered in Extjs4 MVC



frankpeng
17 Nov 2011, 7:12 AM
Can someone tell me why radiofield event is not triggered in Extjs4 MVC?

I tried:
'viewport > casesearch > radiofield'
'viewport > casesearch radiofield'

I also tried the line below which returned all 8 radiofields on the panel. So the code should know the radiofields are there.
Ext.ComponentQuery.query('casesearch > radiofield');

Thanks


controller:


this.control({
//'casesearch button' :{ //working for all button
'casesearch button[id=searchbtnimage_id]' :{
click: this.onCaseSearchBtnClick ////working
} ,
'casesearch > radiofield' : //none working
{
uncheck : function(data){ alert("abc1"); },
checked : function(data){ alert("abc2"); },
handler : function(data){ alert("abc3"); },
click : function(data){ alert("abc4"); },
change : function(data){ alert("abc5"); }
}

});


View:




Ext.define('SC.view.case_search.Case_search', {
extend: 'Ext.panel.Panel',
alias : 'widget.casesearch',
id: 'casesearch_id',
title: 'case search',

initComponent: function() {

this.callParent(arguments);
},

items: [
{
items: [
{
xtype: 'fieldcontainer', //simplified. In real case, this is in a fieldset which is on a panel.
fieldLabel : 'user',
defaultType: 'radiofield',
layout: 'column',
items: [
{
id: 'rd_loginname_0a',
boxLabel : 'all cases'
name : 'FilterLoginName',
columnWidth: .2
},
{
id: 'rd_loginname_1a',
boxLabel : 'my cases only',
name : 'FilterLoginName',
columnWidth: .3
}
]
}
]
}
]
});

frankpeng
17 Nov 2011, 7:13 AM
I reviewed this post. http://www.sencha.com/forum/showthread.php?152769-I-need-a-help-to-add-event-in-radiofield

It is essentially doing what I did. But, mine doesn't work.