Results 1 to 2 of 2

Thread: invalid label error when loading json data in grid

  1. #1

    Default invalid label error when loading json data in grid

    I'm getting an invalid label error when this data payload is passed back on the store.load call:


    {"total_records": 1, "records": [{"Agent.First Name": "David", "Agent.Annual Salary": 54000.0, "Agent.Last Name": "Carpenter"}]}


    this is my reader/store setup:

    store = new Ext.data.Store({
    // load using script tags for cross domain, if the data in on the same domain as
    // this page, an HttpProxy would be better
    proxy: new Ext.data.ScriptTagProxy({
    url: 'http://127.0.0.1:5000/home/get_table_data/'
    }),
    //data: dummyData,
    //reader: reader
    // create reader that reads the data records
    reader: new Ext.data.JsonReader({
    root: 'records',
    totalProperty: 'total_records',
    fields: eval(field_defs)
    })
    });

    where field_defs is actually:
    "[{name: 'Agent.First Name' },{name: 'Agent.Last Name' },{name: 'Agent.Annual Salary' }]"

    and my column model is:
    cm: new xg.ColumnModel([
    new xg.RowNumberer(),
    {id:'Agent.First Name',header: "First Name", width: 110, sortable: true, dataIndex: 'Agent.First Name'},
    {header: "Annual Salary", width: 90, sortable: true, dataIndex: 'Agent.Annual Salary'},
    {header: "Last Name", width: 110, sortable: true, dataIndex: 'Agent.Last Name'}
    ])


    if I change the store to use a local array and use the ArrayReader it works fine, but getting the remote data like above using the paging mechanism and calling store.load(...) fails with 'invalid label'

    what am I doing wrong here? what does invalid label mean?

    thanks,
    Mark

  2. #2
    Sencha User jay@moduscreate.com's Avatar
    Join Date
    Mar 2007
    Location
    DC Area =)
    Posts
    16,364

    Default

    can you halt the use of periods in your names?

Posting Permissions

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