PDA

View Full Version : Having issues with DataStore Returning No Cached data



gbembio2002
23 Jan 2011, 3:33 PM
Can Some one please tell me what is wrong with this. Everytime i try to load the number cache records I get 0 instead of 1.

********************************JAVA SCRIPT*********************************

Ext.onReady(function () {
var DataFields = new Ext.data.Record.create([
{
name: "Author",
mapping: "Author"
},
{
name: "Author",
mapping: "Author"
},
{
name: "Manufacturer",
mapping: "Manufacturer"
},
{
name: "ProductGroup",
mapping: "ProductGroup"
}
]);

var DataXml = new Ext.data.XmlReader({ record: "Item" }, DataFields);

var DataProxyAddress = new Ext.data.HttpProxy({
url: "http://localhost:47483/Responder.aspx"
});


var DataStoreSection = new Ext.data.Store({
autoLoad: true,
proxy: DataProxyAddress,
reader: DataXml
});

alert(DataStoreSection.getCount());


});


************************http://localhost:47483/Responder.aspx*****************************

HttpContext.Current.Response.ClearContent();
HttpContext.Current.Response.ContentType = "text/xml";
TextReader tr = new StreamReader("C:\\inetpub\\wwwroot\\SampleData.xml");
HttpContext.Current.Response.Output.Write(tr.ReadToEnd());
tr.Close();
HttpContext.Current.Response.End();




************************C:\\inetpub\\wwwroot\\SampleData.xml*******************************


<?xml version="1.0" encoding="UTF-8"?>
<Items>
<Item>
<ASIN>0446613657</ASIN>
<DetailPageURL>
http://www.amazon[*SNIP*]JVQEG2
</DetailPageURL>
<ItemAttributes>
<Author>Sidney Sheldon</Author>
<Manufacturer>Warner Books</Manufacturer>
<ProductGroup>Book</ProductGroup>
<Title>Are You Afraid of the Dark?</Title>
</ItemAttributes>
</Item>
</Items>