PDA

View Full Version : Problem with Ext.data.HttpProxy since upgrading



thirstypixel
9 Jun 2009, 12:39 PM
Hey everyone. I have been really struggling with this problem which started happening after I upgraded to Ext 3.0 rc2. I have two combo boxes, when you select the first one it does an ajax call to populate the second combo box. It runs the call when I do proxy.load, and when I check firebug I see that it completes the call and returns the appropriate json array. However as soon as the call is completed I am getting this error message:

o.request.callback is undefined

I am not sure how to debug this... I have been looking all over the forums and in the API for any help but I have been spinning my wheels. I would appreciate any help or insight into the problem and ways I can go about figuring out a resolution. Thanks in advance!

Here is my example code that I am running:


Handler = {
yearSelect: function(o,r,i) {
var year = r.data.value;
var make = Ext.getCmp('SearchMakeBase');
var model = Ext.getCmp('SearchModelBase');
make.setValue('');
model.setValue('');
make.store.proxy.conn.url = '/TireGuide/json_get_makes/'+year;
make.store.proxy.load();
},
}


new Ext.Panel({
renderTo:"FilterDiv",
defaults:{layout:"form", border:false, bodyStyle:"padding:10px", labelAlign:"right", labelWidth:40},
layout:"column",
items:[
new Ext.Panel({
items:[
new Ext.form.ComboBox({
fieldLabel:"Year",
disableKeyFilter:true,
triggerAction:"all",
editable:false,
displayField:"display",
valueField:"value",
lazyInit:false,
forceSelection:true,
width:80,
id:"SearchYearBase",
hiddenName:"data[Search][year]",
hiddenId:"SearchYear",
valueForShowEmptyOption:"",
emptyText:"",
mode:"local",
store: new Ext.data.SimpleStore({
fields: ['value', 'display'],data : [['',''],['2009','2009'],['2008','2008'],['2007','2007'],['2006','2006'],['2005','2005'],['2004','2004'],['2003','2003'],['2002','2002'],['2001','2001'],['2000','2000']],
proxy: new Ext.data.HttpProxy({url:"",method:'POST'})
}),
listeners:{select:Handler.yearSelect},
})
]
}),
new Ext.Panel({
items:[
new Ext.form.ComboBox({
fieldLabel:"Make",
disableKeyFilter:true,
triggerAction:"all",
editable:false,
displayField:"display",
valueField:"value",
lazyInit:false,
forceSelection:true,
id:"SearchMakeBase",
hiddenName:"data[Search][make]",
hiddenId:"SearchMake",
valueForShowEmptyOption:"",
emptyText:"",
mode:"local",
store:new Ext.data.SimpleStore({
fields: ['value', 'display'],
data:[['',' '],],
proxy: new Ext.data.HttpProxy({url: "",method:'POST'}),
}),
listeners:{select:Handler.makeSelect},
})
],
}),
]
});

thirstypixel
9 Jun 2009, 12:54 PM
I was able to fix this by changing the way I load the store:

yearSelect: function(o,r,i) {
var year = r.data.value;
var make = Ext.getCmp('SearchMakeBase');
var model = Ext.getCmp('SearchModelBase');
make.setValue('');
model.setValue('');
make.store.load({params:{year:year}});
},