Page 1 of 2 12 LastLast
Results 1 to 10 of 15

Thread: Uncaught TypeError: Object #<an Object> has no method 'read'

  1. #1
    Sencha User
    Join Date
    Dec 2010
    Posts
    81
    Vote Rating
    0
      0  

    Question Uncaught TypeError: Object #<an Object> has no method 'read'

    hi im getting this error Uncaught TypeError: Object #<an Object> has no method 'read', the code i write is

    Code:
    var NutritionStore = new Ext.data.Store({
    	model: 'Meal',
    	proxy: {
            type: 'ajax',
            url : Application.gv.serverUrl+'/Nutrition/get_plans/123?response_type=xml',
            reader: {
                type: 'xml',
                root: 'data'
            }
        }
    });
    NutritionStore.load();
    where am i wrong unable to solve this problem

  2. #2
    Ext JS Premium Member Steffen Hiller's Avatar
    Join Date
    Mar 2008
    Posts
    786
    Vote Rating
    36
      0  

    Default

    right now the same prob, almost same code, just using json reader ...

    you solved it?

    checking ...

  3. #3
    Ext JS Premium Member Steffen Hiller's Avatar
    Join Date
    Mar 2008
    Posts
    786
    Vote Rating
    36
      0  

    Default

    Hehe, hadn't included the model js file.

    Check if your Meal model is included, loaded!?

  4. #4
    Sencha User
    Join Date
    Dec 2010
    Posts
    81
    Vote Rating
    0
      0  

    Default

    thanks Steffen, yeah i hadn't included my model file, its working fine now

  5. #5
    Ext Premium Member
    Join Date
    Jan 2008
    Posts
    31
    Vote Rating
    0
      0  

    Default

    For everybody who has a similar problem:

    I had this error message too although I have the store and model defined in the same file.
    My problem was that I had to define the model BEFORE the definition of the store.


    Regards,
    Martin

  6. #6
    Sencha User
    Join Date
    Jan 2011
    Posts
    5
    Vote Rating
    0
      0  

    Question Uncaught #<an Object>

    same problem...please tell where m going wrong..

    my code is



    Ext.setup({
    onReady: function() {

    Ext.regModel('customer', {
    fields: [{name: 'customerId', type: 'int'},
    {name: 'customerName', type: 'string'}]
    });

    var store = new Ext.data.Store({
    model: 'customer',
    method: 'GET',
    proxy: {
    type: 'ajax',
    url : 'http://localhost:8080/sencha/www/list_Demo/customer.xml',
    reader: {
    type: 'xml',
    root: 'customers',
    record: 'customer'
    }

    }

    });
    store.load();


    var list = new Ext.List({
    fullscreen: true,
    title: 'xmlList',
    itemTpl : '{customerId} {customerName}',
    grouped : true,
    indexBar: true,

    store: store

    });

    list.show();
    }
    });

  7. #7
    Sencha User
    Join Date
    Dec 2010
    Posts
    81
    Vote Rating
    0
      0  

    Default

    make sure you are returning xml as a response for the server side, another thing you are missing here is that you provided grouped : true but you did not provided getGroupString in the store config. this will give you error Uncaught TypeError: Cannot call method 'toLowerCase' of undefined

  8. #8
    Sencha User
    Join Date
    Jan 2011
    Posts
    5
    Vote Rating
    0
      0  

    Exclamation

    i corrected that part it still gives me an error saying

    Uncaught #<an Object>
    Ext.data.XmlReader.Ext.extend.getResponseDatasencha-touch-debug.js:10036
    Ext.data.Reader.Ext.extend.readsencha-touch-debug.js:9441
    (anonymous function)sencha-touch-debug.js:8707
    Ext.data.Connection.Ext.extend.onCompletesencha-touch-debug.js:17495
    Ext.data.Connection.Ext.extend.onStateChangesencha-touch-debug.js:17442
    (anonymous function)sencha-touch-debug.js:3421

  9. #9
    Sencha User mars0122's Avatar
    Join Date
    May 2011
    Location
    ShenZhen,China
    Posts
    9
    Vote Rating
    0
      0  

    Smile I'm in the same trap

    Just try to do that in other ways, such as defined a structure like a array to contact each data as turned-back format. I've got it in this way.

  10. #10
    Sencha User
    Join Date
    Oct 2007
    Posts
    60
    Vote Rating
    0
      0  

    Default

    I had issues like these. Putting all my code (app, models, stores, views, controllers) in one file seems to have fixed it so far. Its not pretty, but I'm making forward progress again.

Page 1 of 2 12 LastLast

Similar Threads

  1. Replies: 4
    Last Post: 3 Aug 2011, 2:54 PM
  2. Uncaught TypeError: Cannot read property 'length' of undefined
    By a2rdvark in forum Sencha Touch 1.x: Discussion
    Replies: 5
    Last Post: 23 Dec 2010, 3:48 PM
  3. IndexBar ( Uncaught TypeError: Object has no method 'getItemId' )
    By ushiday in forum Sencha Touch 1.x: Discussion
    Replies: 0
    Last Post: 14 Oct 2010, 7:53 PM
  4. Uncaught TypeError: Object #<an Object> has no method 'addEvents'
    By busybee in forum Ext 3.x: Help & Discussion
    Replies: 3
    Last Post: 6 Oct 2010, 2:34 AM
  5. Replies: 1
    Last Post: 18 Jun 2010, 12:54 AM

Posting Permissions

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