babar.sajjad
26 Jan 2011, 12:47 PM
i have two models plans and meals with plan hasMany relationship with meals and this is my store
Application.gv.mStore = new Ext.data.Store({
autoLoad: true,
model: "Plan",
proxy: {
type: 'ajax',
url : 'http://localhost/myplan/get_plans/4a6d9721-d0dc-44f5-9429',
reader: {
type: 'xml',
root: 'Plans',
reader: 'Meals'
}
}
});
xml i am consuming is like this
<?xml version="1.0" encoding="utf-8"?>
<nutritions_response>
<response>
<Plans>
<id>123</id>
<name>babar</name>
<Meals>
<item>
<id>456</id>
<name>breakfast</name>
</item>
<item>
<id>456</id>
<name>breakfast</name>
</item>
</Meals>
</Plans>
</response>
</nutritions_response>
my plan object get filled with the data but meal object remains empty if i change reader to item then my plan object is filled with meal data, do not know what to do :(
Application.gv.mStore = new Ext.data.Store({
autoLoad: true,
model: "Plan",
proxy: {
type: 'ajax',
url : 'http://localhost/myplan/get_plans/4a6d9721-d0dc-44f5-9429',
reader: {
type: 'xml',
root: 'Plans',
reader: 'Meals'
}
}
});
xml i am consuming is like this
<?xml version="1.0" encoding="utf-8"?>
<nutritions_response>
<response>
<Plans>
<id>123</id>
<name>babar</name>
<Meals>
<item>
<id>456</id>
<name>breakfast</name>
</item>
<item>
<id>456</id>
<name>breakfast</name>
</item>
</Meals>
</Plans>
</response>
</nutritions_response>
my plan object get filled with the data but meal object remains empty if i change reader to item then my plan object is filled with meal data, do not know what to do :(