PDA

View Full Version : dispatch from selectfield change



brdsgigz
31 Oct 2011, 7:41 AM
I have a selectfield with a change listener. I am using a dispatch is the function to call an action from the controller. I know the controller action function is being called, but the view is not changing. There are no syntax errors. Is there some reason why a select list can't be used for navigation like this? Is there a better way to handle this? Here is my code:

xtype: 'fieldset', title: 'Events', items:
[
{
xtype: 'selectfield',
id: 'viewby',
name: 'viewby',
label: 'View by:',
value:'All',
labelWidth:'100px',
listeners: {
change: {
fn: function(field, newValue){
Ext.dispatch({
controller: 'Event',
action : newValue,
historyUrl: "event/index"}); }
}

},
options:
[
{text: 'All', value: 'All'},
{text: 'Event Type A', value: 'Event Type A'},
]
}

mitchellsimoens
1 Nov 2011, 5:25 AM
So if you select a different value and the change event fires, the selectfield doesn't show the new value?