1. #1
    Sencha User
    Join Date
    Jan 2012
    Posts
    1
    Vote Rating
    0
    dal is on a distinguished road

      0  

    Default Uncaught TypeError: Cannot read property 'idProperty' of undefined

    Uncaught TypeError: Cannot read property 'idProperty' of undefined


    I have a very simple app. For some reason i'm getting this error message Uncaught TypeError: Cannot read property 'idProperty' of undefined

    Can someone tell me why?



    Ext.Loader.setConfig({ enabled: true });


    Ext.application({
    name: 'DeviceControl',
    appFolder: '../Scripts/DeviceControl',


    controllers: ['DeviceControl.controller.CDevice'],




    autoCreateViewport: true,
    launch: function ()
    {


    //this is to be fired as soon as the page is ready

    }
    });



    Ext.define('DeviceControl.view.Viewport', {
    extend: 'Ext.container.Viewport',
    layout: 'fit',


    requires: [
    'DeviceControl.view.VDevice',

    ],


    initComponent: function ()
    {
    this.items =
    {

    items: [{
    width: 250,
    xtype: 'DeviceView'

    }]

    };


    this.callParent();
    }
    });


    Ext.define('DeviceControl.view.VDevice',
    {
    extend: 'Ext.form.Panel',
    alias: 'widget.DeviceView',
    store: ['DeviceControl.store.SDevice'],




    //controls go here



    initComponent: function ()
    {
    this.items =
    [
    {
    xtype: 'button',

    id:'HBtn'


    }

    ]


    this.callParent(arguments);
    }
    });


    Ext.define('DeviceControl.model.MDevice', {
    extend: 'Ext.data.Model',
    // requires: 'DeviceControl.classes.jsonDeviceProxy',
    fields: [
    { name: 'DeviceId', type: 'int' },
    { name: 'Heading', type: 'string' }
    ]
    // hasMany: { model: 'Command', name: 'commands' }


    });


    Ext.define('DeviceControl.store.SDevice', {
    extend: 'Ext.data.Store',
    requires: ['DeviceControl.model.MDevice'],
    model: ['DeviceControl.model.MDevice'],
    autoLoad: true,


    proxy:
    {


    type: 'ajax',
    url: 'data/ControlPage.json',
    headers: { 'Content-Type': 'application/json; charset=utf-8', 'Accept': 'application/json' },
    reader:
    {
    type: 'json',
    root: 'results',
    successP:'success'
    }


    },


    load: function ()
    {


    console.log('store');


    }
    });



    Data:

    {
    'success': true,
    'results':
    [
    {
    'DeviceId': '7',
    'Heading': 'Stevie Ray Vaughan',

    }


    ]
    }

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,647
    Vote Rating
    898
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    Ext JS 4?
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  3. #3
    Sencha User
    Join Date
    Apr 2011
    Location
    Hyderabad
    Posts
    27
    Vote Rating
    2
    shilpay is on a distinguished road

      0  

    Default Uncaught TypeError: Cannot read property 'idProperty' of undefined

    Uncaught TypeError: Cannot read property 'idProperty' of undefined


    Hi,

    I got the same error in ExtJs4.1.

Thread Participants: 2