PDA

View Full Version : Need help on xmlreader



Suresh
30 Jul 2007, 4:25 AM
I created data store like below. Getting data from server side using the url 'intervalTable'.


var ds = new Ext.data.Store({
// load using HTTP
proxy: new Ext.data.HttpProxy({url: 'intervalTable'}),

// the return will be XML, so lets set up a reader
reader: new Ext.data.XmlReader({
// records will have an "Item" tag
record: 'intervalrow',
totalRecords: '@total_rows'
}, [
// set up the fields mapping into the xml doc
// The first needs mapping, the others are very basic
{name: 'timeStamp', mapping:'@timeStamp'},
{name: 'id', mapping: '@id'},
{name: 'talkTime', mapping:'@talkTime',type: 'int'}

])
});


var cm = new Ext.grid.ColumnModel([
{header: "Time", width: 180, dataIndex: 'timeStamp'},
{header: "Team", width: 180, dataIndex: 'id'}
]);

grid.render();

var gridFoot = grid.getView().getFooterPanel(true);
// add a paging toolbar to the grid's footer
var paging = new Ext.PagingToolbar(gridFoot, ds, {
pageSize: 50,
displayInfo: true,
displayMsg: 'Displaying topics {0} - {1} of {2}',
emptyMsg: "No topics to display"
});
// trigger the data store load
ds.load({params:{start:0, limit:50}});

I can see the response xml in the FireBug, but xmlreader is not parsing the xml even the response type is set to 'text/xml'. I am not able to figure out what could be the problem. Can any one help on this.

tryanDLS
30 Jul 2007, 8:51 AM
Please post your code in CODE tags. Set a BP in XmlReader and step thru the load function to see if you're getting an error.

Suresh
31 Jul 2007, 12:44 AM
Hi,

I don't know how to give Break Point, Can you mentioned some example.

tryanDLS
31 Jul 2007, 8:34 AM
I suggest you read the Learning section of the website and also the sticky posts here. There are a number that discuss debugging tools. You really need to learn how to debug code in general, regardless of what framework you're coding in.

Suresh
31 Jul 2007, 8:25 PM
I used the Firebug and debugged that, the xml having spaces at the end, because of this its not loaded. Thanks for your help.