Hi,
I have created this on app on django that lists fields from the database.
Say countries app, added to admin. I have a view
http://localhost:8000/countries that returns a json string of the countries
in the database. I would like to load it onto a jsonreader store with little
success. Attaches is my ext js script to do so. Any pointers on what i am
doing wrong?
var zoomstore = new Ext.data.Store(
{
autoLoad:true,
proxy: new Ext.data.HttpProxy(
{
url:"/countries",
method:"GET",
}),
reader: new Ext.data.JsonReader(
{
root: 'counties',
totalProperty: 'total',
}, [{name: 'countyname'}])
});
datesStore.load();
Ext.Msg.alert('etat',zoomstore.getCount().toString());
The alert returns 0; meaning the store is not being loaded. Any pointers on
what i am doing wrong. I am using the django serialiser for the view. which
is
data = serializers.serialize('json', Country.objects.all(),
fields=('id','countyname'))
return HttpResponse(data)
Please help.