1. #1
    Sencha User
    Join Date
    Jul 2010
    Posts
    13
    Vote Rating
    0
    Johnnyger is on a distinguished road

      0  

    Default Uncaught TypeError (JsonStore)

    Uncaught TypeError (JsonStore)


    Hi,

    I tried to make a JsonStore:

    Code:
    var patientStore = new Ext.data.JsonStore({
    			storeId: 'patientStore',
    			model: 'Patient',
    			autoLoad: true,
    			proxy: {
    				type: 'ajax', //after commenting this line the error disappears
    				url: 'patientData3.php',
    				reader: {
    					root: 'results'
    				}
    			}
    	
    });
    I get the following Errormessage:
    "Uncaught TypeError: Cannot read property 'prototype' of undefined (/sencha-touch/ext-touch-debug.js:11799)"

    I have no clue, why...


    Kai

  2. #2
    Sencha - Ext JS Dev Team evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    17,167
    Vote Rating
    674
    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


    There's no point using a JsonStore, since you already specify the proxy/reader.

    Code:
    var patientStore = new Ext.data.Store({
    			storeId: 'patientStore',
    			model: 'Patient',
    			autoLoad: true,
    			proxy: {
    				type: 'ajax', //after commenting this line the error disappears
    				url: 'patientData3.php',
    				reader: {
    					root: 'results'
    				}
    			}
    	
    });
    Also make sure you're using the latest beta.
    Evan Trimboli
    Sencha Developer
    Twitter - @evantrimboli
    Don't be afraid of the source code!

  3. #3
    Sencha User
    Join Date
    Jul 2010
    Posts
    13
    Vote Rating
    0
    Johnnyger is on a distinguished road

      0  

    Default


    Hi, thanks, i took your advices, but still getting the same undefined-error.
    This is my code now:

    Code:
    var patientStore = new Ext.data.JsonStore({
    			autoLoad: true,
    			url: 'patientData3.php',
    			root: 'results',
    			fields: [
    				'firstName',
    				'lastName',
    				'state'
    			]
    });
    the JSON data:

    Code:
    {
    			"results": [
    				{ "firstName": "Max", "lastName": "Mustermann1", "state": "kritisch" },
    				{ "firstName": "Max", "lastName": "Mustermann2", "state": "kritisch" },
    			]
    		}
    I am using the latest beta.

  4. #4
    Sencha - Ext JS Dev Team evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    17,167
    Vote Rating
    674
    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


    Use the code I specified above.
    Evan Trimboli
    Sencha Developer
    Twitter - @evantrimboli
    Don't be afraid of the source code!

  5. #5
    Sencha User
    Join Date
    Jul 2010
    Posts
    13
    Vote Rating
    0
    Johnnyger is on a distinguished road

      0  

    Default


    works like a charme, thanks for quick an good answer!

Similar Threads

  1. typeerror: w.constrain is not a function
    By xgeoff in forum Sencha Touch 1.x: Discussion
    Replies: 2
    Last Post: 4 Aug 2010, 9:20 AM
  2. Replies: 1
    Last Post: 18 Jun 2010, 12:54 AM
  3. [SOLVED] TypeError when updating to 3.1
    By PranKe01 in forum Ext 3.x: Help & Discussion
    Replies: 1
    Last Post: 5 Jan 2010, 3:48 AM
  4. loadexception with JsonStore: TypeError: Record has no properties
    By samskeyti in forum Ext 2.x: Help & Discussion
    Replies: 2
    Last Post: 7 Apr 2008, 2:59 AM

Thread Participants: 1