1. #1
    Ext User
    Join Date
    Oct 2010
    Posts
    6
    Vote Rating
    0
    a2rdvark is on a distinguished road

      0  

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

    Uncaught TypeError: Cannot read property 'length' of undefined


    hello.

    i want to store json data to Ext.data.Store, but i have problem.

    code is below :

    Ext.regModel('names', {
    fields : ['NAME1', 'REGIO', 'ORTO1', 'KUNNR', 'STRAS']
    });

    Ext.setup({
    onReady : function() {
    var jsonData = new Ext.data.Store({
    autoLoad : true,
    model : 'names',
    proxy : {
    type : 'ajax',
    url : 'test.json',
    reader : {
    type : 'json',
    root : 'CUSTOMER_GENERAL'
    }
    }
    });
    }
    });

    and content of test.json is below :

    {"CUSTOMER_GENERAL" :[
    {"NAME1":"asdf1","REGIO":"661","ORTO1":"sdfg1","KUNNR":"sdfg1","STRAS":"STRAS1"},
    {"NAME1":"asdf2","REGIO":"662","ORTO1":"sdfg2","KUNNR":"sdfg2","STRAS":"STRAS2"},
    {"NAME1":"asdf3","REGIO":"663","ORTO1":"sdfg3","KUNNR":"sdfg3","STRAS":"STRAS3"}
    ]
    }

    when i execute this js file at chrome browser

    ext-touch-debug.js:6615 Uncaught TypeError: Cannot read property 'length' of undefined

    error message come out.

    how can i solve this problem?

    thx for reading my question.

  2. #2
    Sencha - Ext JS Dev Team evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    16,129
    Vote Rating
    516
    evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute

      0  

    Default


    Make sure you're running the latest version, runs fine for me.
    Evan Trimboli
    Sencha Developer
    Twitter - @evantrimboli
    Don't be afraid of the source code!

  3. #3
    Ext User
    Join Date
    Oct 2010
    Posts
    6
    Vote Rating
    0
    a2rdvark is on a distinguished road

      0  

    Default


    well..

    i use the lates version. i downloaded it 2 hours ago..

    my version is 0.98

  4. #4
    Sencha - Ext JS Dev Team evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    16,129
    Vote Rating
    516
    evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute

      0  

    Default


    It ran fine for me, I copied and pasted your code exactly.
    Evan Trimboli
    Sencha Developer
    Twitter - @evantrimboli
    Don't be afraid of the source code!

  5. #5
    Sencha User
    Join Date
    Mar 2010
    Posts
    36
    Vote Rating
    0
    stevek is on a distinguished road

      0  

    Default


    Hi,
    I am doing something similar - and it does not work for me.
    Here is my code below.

    Code:
    var store = new Ext.data.Store({
                model: 'Audit',
                proxy: {
                    extraParams: {filters: []},
                    reader: {
                        root: 'audits',
                        type: 'json'
                    },
                    type: 'rest',
                    url: 'audit/load'
                }
    });
    
    store.proxy.extraParams.case_no = '20100001';
    store.load();
    Someone please help.

  6. #6
    Sencha User
    Join Date
    Mar 2010
    Posts
    36
    Vote Rating
    0
    stevek is on a distinguished road

      0  

    Default


    Fixed the problem. I changed type: 'rest' to type: 'ajax' and it worked.
    But this problem, I believe, is a bug for the rest proxy that should be fixed.
    Can anyone indicate when v1.0.1a will be released to the public?

    Say, any idea if the development team will add a grid panel widget to the sencha touch API (like they have in ExtJS). It's great that someone wrote the TouchGridPanel - but I would be a nice reflection on the API itself if this widget were part of its library.

Similar Threads

  1. Replies: 4
    Last Post: 30 Jun 2011, 11:00 AM
  2. Cannot read property 'ownerCt' of undefined
    By qbert65536 in forum Sencha Touch 1.x: Discussion
    Replies: 3
    Last Post: 23 Sep 2010, 3:42 PM
  3. Uncaught TypeError: Cannot call method 'indexOf' of undefined
    By cwebb in forum Sencha Touch 1.x: Discussion
    Replies: 11
    Last Post: 9 Sep 2010, 6:59 PM
  4. TypeError: Cannot read property 'parentNode' of undefined
    By zurdophp in forum Ext 3.x: Help & Discussion
    Replies: 1
    Last Post: 2 Sep 2010, 5:58 AM
  5. Uncaught TypeError (JsonStore)
    By Johnnyger in forum Sencha Touch 1.x: Discussion
    Replies: 4
    Last Post: 2 Sep 2010, 1:12 AM

Thread Participants: 2

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar