Results 1 to 5 of 5

Thread: Need help on xmlreader

  1. #1
    Ext JS Premium Member
    Join Date
    Jul 2007
    Posts
    19

    Smile Need help on xmlreader

    I created data store like below. Getting data from server side using the url 'intervalTable'.

    Code:
    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.

  2. #2
    Sencha User
    Join Date
    Mar 2007
    Posts
    7,854

    Default

    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.

  3. #3
    Ext JS Premium Member
    Join Date
    Jul 2007
    Posts
    19

    Default

    Hi,

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

  4. #4
    Sencha User
    Join Date
    Mar 2007
    Posts
    7,854

    Default

    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.

  5. #5
    Ext JS Premium Member
    Join Date
    Jul 2007
    Posts
    19

    Default

    I used the Firebug and debugged that, the xml having spaces at the end, because of this its not loaded. Thanks for your help.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •