-
10 Sep 2010 6:44 AM #1
Uncaught TypeError: Cannot call method 'split' of undefined (ext-touch-debug.js:9555
Uncaught TypeError: Cannot call method 'split' of undefined (ext-touch-debug.js:9555
Hi,
I have a problem to load data on Store.
The image file attached shows error I've got.
the code I made is below.
Please, help me!
Code:<script type="text/javascript" src="../../ext-touch-debug.js"></script> <script type="text/javascript"> Ext.setup({ tabletStartupScreen: 'resources/img/tablet_startup.png', phoneStartupScreen: 'resources/img/phone_startup.png', icon: 'resources/img/icon.png', glossOnIcon: false, onReady: function() { var data = { person: [{ id: '0001', name: 'James' }, { id: '0002', name: 'Tom' }] }; var tpl = new Ext.XTemplate( '<tpl for=".">', '<p>{#}. {name}</p>', '</tpl></p>' ); Ext.regModel('tModel', { fields: [ {name: 'id', type: 'string'}, {name: 'name', type: 'string'} ] }); this.tStore = new Ext.data.JsonStore({model: 'tModel'}); this.tStore.loadData(data.person); var viewport = new Ext.List({ fullscreen: true, scroll: 'vertical', tpl: tpl, store: this.tStore // data: data.person }); } }); </script>
-
25 Sep 2010 9:37 AM #2
-
26 Sep 2010 1:01 PM #3
-
1 Oct 2010 9:52 AM #4
I ran into this problem too. You need to provide an itemSelector to the Ext.List .
ie:
Code:<script type="text/javascript"> Ext.setup({ tabletStartupScreen: 'resources/img/tablet_startup.png', phoneStartupScreen: 'resources/img/phone_startup.png', icon: 'resources/img/icon.png', glossOnIcon: false, onReady: function() { var data = { person: [{ id: '0001', name: 'James' }, { id: '0002', name: 'Tom' }] }; var tpl = new Ext.XTemplate( '<tpl for=".">', '<p class="someClass">{#}. {name}</p>', '</tpl></p>' ); Ext.regModel('tModel', { fields: [ {name: 'id', type: 'string'}, {name: 'name', type: 'string'} ] }); this.tStore = new Ext.data.JsonStore({model: 'tModel'}); this.tStore.loadData(data.person); var viewport = new Ext.List({ itemSelector: 'p.someClass', fullscreen: true, scroll: 'vertical', tpl: tpl, store: this.tStore }); } }); </script>
-
30 Jun 2011 11:00 AM #5
I had similar situation and my problem was that I forgot to provide the record element to the proxy.
Example:
My xml data was in the following format:Code:proxy: { type: 'ajax', url: 'app/data/entities.xml', reader: { type: 'xml', root: 'Entities', record: 'Entity' //you get the same error if you miss to provide this } },
Code:<?xml version="1.0" encoding="UTF-8"?> <Entities> <Entity> <id>1</id> <fname>Bob</fname> <lname>Dole</lname> <description>Boddy!</description> <level>10</level> </Entity> <Entity> <id>2</id> <fname>Jake</fname> <lname>Fake</lname> <description>Faker</description> <level>20</level> </Entity> <Entity> <id>3</id> <fname>Kirk</fname> <lname>Dirk</lname> <description>Tester</description> <level>30</level> </Entity> </Entities>
Similar Threads
-
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 -
Uncaught TypeError (JsonStore)
By Johnnyger in forum Sencha Touch 1.x: DiscussionReplies: 4Last Post: 2 Sep 2010, 1:12 AM -
Newbie.. how to solve "Uncaught TypeError: Object #(an Object) has no method ''
By ericw in forum Ext 3.x: Help & DiscussionReplies: 1Last Post: 18 Jun 2010, 12:54 AM -
uncaught exception: Permission denied to call method XMLHttpRequest.open
By blackperl in forum Ext 2.x: Help & DiscussionReplies: 4Last Post: 26 Feb 2009, 6:16 AM -
uncaught exception: Permission denied to call method XMLHttpRequest.open
By lalit_ce in forum Ext 2.x: Help & DiscussionReplies: 1Last Post: 13 Jan 2009, 2:05 AM


Reply With Quote