View Full Version : Load Store with Xml Response

15 Dec 2011, 7:06 AM
I am getting following response from server.


I am trying to load this xml respone in following store -

Ext.define('DataRecord', {
extend: 'Ext.data.Model',
fields: [
{name: 'Id'},
{name: 'FirstName', mapping : 'Person>FirstName'},
{name: 'LastName', mapping : 'PersonLastName'},
{name: 'Status'},
{name: 'Comments'},
{name: 'Approval'},
{name: 'EmailAddress', mapping : 'Person>EmailAddress'},
{name: 'PersonId', mapping : 'Person>Id'},
{name: 'ResponseType', type:'int'}

var dataStore = new Ext.data.Store({
model: 'DataRecord',
proxy: {
type: 'ajax',
url: "xyz.do"
reader: {
type: 'xml',
root: 'Root',
record: 'Response',
totalProperty: "TotalRecords",
model: 'DataRecord'
But, Store is no getting loaded. Store returns count 0. I am stuck with this. Can you help?

15 Dec 2011, 2:44 PM
Did you execute load() on the store? I just tested your code and it works 100%.

16 Dec 2011, 12:23 AM
Yes, i am executing load() on store. Actually i am loading this from other ext component.

op: 9,
Id: selectedId,
showResponse: true,
start: 0,
limit: 10

I tried to debug this in detail. While debugging i found out -
reader is returning all records after read but while committing read records
in ext-all-debug.js file on line no. 20113,

clientRecords = me.records;
me.records is undefined.

Can you post your code?

16 Dec 2011, 5:36 AM
Can you post your code?

I used your code and loaded against an XML file. I didn't change anything.

16 Dec 2011, 6:50 AM
For xml file, code works. But, when i use store.load({ params: params}); as i have mentioned in earlier post, code does not work.