-
28 Oct 2010 8:29 PM #1
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.
-
28 Oct 2010 8:56 PM #2
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!
-
28 Oct 2010 9:33 PM #3
well..
i use the lates version. i downloaded it 2 hours ago..
my version is 0.98
-
28 Oct 2010 9:33 PM #4
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!
-
23 Dec 2010 3:37 PM #5
Hi,
I am doing something similar - and it does not work for me.
Here is my code below.
Someone please help.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();
-
23 Dec 2010 3:48 PM #6
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
-
Uncaught TypeError: Cannot call method 'split' of undefined (ext-touch-debug.js:9555
By fermina in forum Sencha Touch 1.x: DiscussionReplies: 4Last Post: 30 Jun 2011, 11:00 AM -
Cannot read property 'ownerCt' of undefined
By qbert65536 in forum Sencha Touch 1.x: DiscussionReplies: 3Last Post: 23 Sep 2010, 3:42 PM -
Uncaught TypeError: Cannot call method 'indexOf' of undefined
By cwebb in forum Sencha Touch 1.x: DiscussionReplies: 11Last Post: 9 Sep 2010, 6:59 PM -
TypeError: Cannot read property 'parentNode' of undefined
By zurdophp in forum Ext 3.x: Help & DiscussionReplies: 1Last Post: 2 Sep 2010, 5:58 AM -
Uncaught TypeError (JsonStore)
By Johnnyger in forum Sencha Touch 1.x: DiscussionReplies: 4Last Post: 2 Sep 2010, 1:12 AM


Reply With Quote