Results 1 to 2 of 2

Thread: Could not create xml store

  1. #1

    Default Could not create xml store

    xml file is
    <?xmlversion="1.0"encoding="utf-8" ?>
    <
    items>
    <
    count>5</count>
    <
    item>
    <
    id>1</id>
    <
    Column>Col1</Column>
    </
    item>
    <
    item>
    <
    id>2</id>
    <
    Column>Col2</Column>
    </
    item>
    <
    item>
    <
    id>3</id>
    <
    Column>Col3</Column>
    </
    item>
    <
    item>
    <
    id>4</id>
    <
    Column>Col4</Column>
    </
    item>
    <
    item>
    <
    id>5</id>
    <
    Column>Col5</Column>
    </
    item>
    </
    items>

    code is
    storeColumns = new Ext.data.xmlStore({
    url:
    'Columns.xml',
    totalRecords:
    'count',
    record:
    'item',
    idPath:
    'id',
    fields: [{name:
    'Col', mapping:'Column'}]
    });

    it throws an error called
    Microsoft JScript runtime error: Object expected

    Could you please help

  2. #2
    Sencha User fay's Avatar
    Join Date
    Apr 2007
    Location
    Ireland
    Posts
    1,750

    Default

    For a start the xml file should begin with a space between xml and version:

    Code:
     
    <?xml version="1.0" encoding="utf-8" ?>


    and the class is Ext.data.XmlStore not Ext.data.xmlStore.

    Also, I'd recommend using FireFox+FireBug for developing+debugging, before testing on other browsers - you'll get much better (verbose) error messages.

Similar Threads

  1. Create Form Using xml
    By extjs_mahendra in forum Ext 3.x: Help & Discussion
    Replies: 7
    Last Post: 26 Jan 2011, 1:21 AM
  2. Replies: 1
    Last Post: 13 Jan 2010, 9:22 AM
  3. How to Create a Store from non-Array, JSON, and XML sources?
    By cnfcruz in forum Ext 2.x: Help & Discussion
    Replies: 11
    Last Post: 1 Sep 2009, 12:24 AM
  4. Replies: 2
    Last Post: 29 Jul 2009, 9:12 AM
  5. create Tree from XML
    By Dobranchy in forum Ext 2.x: Help & Discussion
    Replies: 2
    Last Post: 7 Jan 2008, 12:31 PM

Posting Permissions

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