Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7090139
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T08:00:34+00:00 2026-05-28T08:00:34+00:00

I updated this with as you suggested it doesnt seem to run with the

  • 0

I updated this with as you suggested it doesnt seem to run with the updated mapping either..doesnt seem to get this Ext.data.XmlReader’s field mapping to work.

Ext.require([
    'Ext.data.*',
    'Ext.grid.*'
]);

    Ext.onReady(function(){
    Ext.define('Book',{
        extend: 'Ext.data.Model',
        fields: [
            // set up the fields mapping into the xml doc
            // The first needs mapping, the others are very basic
            'Time', 'UserID', 'Type', 'Description','val0'
        ]
    });


        // create the Data Store
    var store = Ext.create('Ext.data.Store', {
        model: 'Book',
        autoLoad: true,
        proxy: {
            // load using HTTP
            type: 'ajax',
            url: 'audit-v2.xml',
            // the return will be XML, so lets set up a reader
            reader: {
                type: 'xml',
                // records will have an "Item" tag
                //record: 'rows',
               // idProperty: 'ASIN',
                //totalRecords: '@total'
                 root: 'Root',
                 record: 'AuditTrail'
            }
        }
    });


    // create the grid
    var grid = Ext.create('Ext.grid.Panel', {
        store: store,
        columns: [
            {text: "Time", flex: 1, dataIndex: 'Time', sortable: true},
            {text: "UserId", width: 180, dataIndex: 'UserId', sortable: true},
            {text: "Type", width: 115, dataIndex: 'Type', sortable: true},
            {text: "Description", width: 100, dataIndex: 'Description', sortable: true}
            {text: "Value", width: 100, dataIndex: 'Value', sortable: true}
        ],
        renderTo:'example-grid',
        width: 540,
        height: 200
    });
});

Here is the xml

<?xml version="1.0" encoding="UTF-8"?>
  <Root>
    <AuditTrail>
      <Time>2012-01-10 09:27:30 (GMT-05:00)</Time>
      <UserID>DX</UserID>
      <Type>FY [REC]</Type>
      <Description>Server: wamp</Description>
      <val0>1</val0>
    </AuditTrail>
    <AuditTrail>
      <Time>2012-01-10 09:27:30 (GMT-05:00)</Time>
      <UserID>DX</UserID>
      <Type>FY [REC]</Type>
      <Description>Server:tomcat</Description>
      <val0>1</val0>
    </AuditTrail>
    <AuditTrail>
      <Time>2012-01-10 09:27:30 (GMT-05:00)</Time>
      <UserID>DX</UserID>
      <Type>FY [REC]</Type>
      <Description>Server: apache</Description>
      <val0>1</val0>
    </AuditTrail>
</Root>

It doesnt seem to be loading the xml

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T08:00:34+00:00Added an answer on May 28, 2026 at 8:00 am

    You set the record property of the reader one level too high. In your case, I believe it would be best to set root to Root and record to AuditTrail. Also, on your Book model, you should change the mapping of your time field to not do a relative query, i.e., your record field will be AuditTrail, so you don’t need to drill down a level in the query:

        // ...
    
        Ext.define('Book',{
            extend: 'Ext.data.Model',
            fields: ['Time', 'UserID', 'Type', 'Description','val0']
        });
    
        // ...
    
        proxy: {
            // load using HTTP
            type: 'ajax',
            url: 'audit-v2.xml',
            // the return will be XML, so lets set up a reader
            reader: {
                type: 'xml',
                root: 'Root',
                record: 'AuditTrail'
            }
        }
    
        // ...
    

    Your store is expecting data indexes to be at the level of AuditTrail elements, that is why I mentioned you should set record to AuditTrail.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Updated Question: $(this).attr(EmployeeId, 'A42345'); $.ajax({ type: POST, url: url, data: {EmployeeId: ' + id
-- This is an updated post, old post removed -- Suppose I have data
Update As suggested by many people, it looks like this was because of the
Update: I updated this after doing some digging and realizing that this might be
Hey! Total CakePHP noob here. Updated at bottom / This is sort of a
N.B THIS QUESTION HAS BEEN UPDATED, READ FURTHER DOWN Hi, I want to create
Update: This turned into a blog post, with updated links and code, over at
I have this classic ASP site which has been working fine until we updated
I have a table of frequently updated information. This is presented using a container
Post updated to reflect partial fix suggested by @Kate. Original post below new post:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.