PDA

View Full Version : Ext.DataView : Uncaught TypeError: Cannot read property 'length' of undefined



rockinthesixstring
21 Jun 2011, 7:06 PM
I'm getting the error Uncaught TypeError: Cannot read property 'length' of undefined when I try and load Json Data into an Ext.DataView


rpc.controllers.AboutController = new Ext.Panel({
id: 'rpc-controllers-AboutController',
title: 'About',
iconCls: 'info',
layout: 'card',
scroll: 'vertical',
items:[rpc.views.About.index],
dockedItems: [{ xtype: 'toolbar', title: 'RockPointe Church | Mobile'}]
});
rpc.views.About.index = new Ext.DataView({
id: 'rpc-views-about-index',
itemSelector: 'div#about-index',
tpl: '<tpl for"."><div id="about-index">{results}</div></tpl>',
store: rpc.stores.AboutStore,
fullscreen: true,
scroll: 'vertical'
});
rpc.stores.AboutStore = new Ext.data.Store({
id: 'rpc-stores-aboutstore',
model: 'rpc.models.AboutModel',
autoLoad: true,
proxy: {
type: 'scripttag',
url: WebService('About', 'Index'),
method: 'GET',
reader: {
type: 'json',
root: 'html'
}
}
});

rpc.stores.AboutStore.proxy.addListener('exception', function (proxy, response, operation) {
console.log(response.status);
console.log(response.responseText);
alert(response.status);
});



rpc.models.AboutModel = Ext.regModel('rpc.models.AboutModel', {
fields: ['results']
});



Callback1001({"results":{"html":"\u003c!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\"\u003e\n\u003chtml xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en-gb\" lang=\"en-gb\" dir=\"ltr\"\u003e\n\u003chead\u003e\n\t \u003cbase href=\"http://www.rockpointe.ca/\" /\u003e\n \u003cmeta http-equiv=\"content-type\" content=\"text/html; charset=utf-8\" /\u003e\n \u003cmeta name=\"robots\" content=\"index, follow\" /\u003e\n \u003cmeta name=\"keywords\" content=\"ministries, serve, ministry, audio, arts, rockpointe, teams, technical, worship, team, lighting, creative, video, facilitate, rental\" /\u003e\n \u003cmeta name=\"title\" content=\"Technical Arts Ministry - RockPointe Church\" /\u003e\n \u003cmeta name=\"author\" content=\"Administrator\" /\u003e\n \u003cmeta name=\"description\" content=\"Technica\" /\u003e\n \u003cmeta name=\"generator\" content=\"Joomla! 1.5 - Open Source Content Management\" /\u003e\n \u003ctitle\u003eTechnical Arts Ministry - RockPointe Church\u003c/title\u003e\n \u003clink href=\"http://www.rockpointe.ca/techgeneral/technical-arts-ministry\" rel=\"canonical\" /\u003e\n \u003clink href=\"/favicon.ico\" rel=\"shortcut icon\" type=\"image/x-icon\" /\u003e\n \u003clink rel=\"stylesheet\" href=\"/components/com_rsform/assets/calendar/calendar.css\" type=\"text/css\" /\u003e\n \u003clink rel=\"stylesheet\" href=\"/components/com_rsform/assets/css/front.css\" type=\"text/css\" /\u003e\n \u003clink rel=\"stylesheet\" href=\"http://www.rockpointe.ca/plugins/content/amazonWS/css/amazonWS.css\" type=\"text/css\" /\u003e\n \u003cstyle type=\"text/css\"\u003e\n \u003c!--\n.kasocialplugin {display:-moz-inline-block; float:left; width:100%;}.kafbshare {float:left; margin:5px;}.kafblike {float:left; margin:5px;}\n --\u003e\n \u003c/style\u003e\n \u003cscript type=\"text/javascript\" src=\"/media/system/js/mootools.js\"\u003e\u003c/script\u003e\n \u003cscript type=\"text/javascript\" src=\"/media/system/js/caption.js\"\u003e\u003c/script\u003e\n\n\t\u003clink rel=\"stylesheet\" href=\"/templates/system/css/general.css\" type=\"text/css\" /\u003e\n\t\u003clink rel=\"stylesheet\" href=\"/templates/theme509/css/template.css\" type=\"text/css\" /\u003e\n\u003chtml xmlns=\"http://www.w3.org/1999/xhtml\" xmlns:fb=\"http://www.facebook.com/2008/fbml\"\u003e\u003c/head\u003e\n\u003cbody class=\"contentpane\"\u003e\n\t\n\t\u003cdiv class=\"article-title\"\u003e\r\n \u003ctable class=\"contentpaneopen\"\u003e\r\n \u003ctr\u003e\r\n \u003ctd class=\"contentheading\" width=\"100%\"\u003e\r\n \u003cdiv class=\"article-title-text\"\u003e Technical Arts Ministry \u003c/div\u003e\r\n \u003cdiv class=\"article-indent\"\u003e \u003c/div\u003e\r\n \u003c/td\u003e\r\n \u003ctd width=\"100%\"\u003e\u003cdiv class=\"icon-indent\"\u003e\r\n \u003ctable\u003e\r\n \u003ctr\u003e\r\n \u003ctd align=\"right\" width=\"100%\" class=\"buttonheading\"\u003e\u003ca href=\"/techgeneral/technical-arts-ministry/pdf\" title=\"PDF\" onclick=\"window.open(this.href,\u0027win2\u0027,\u0027status=no,toolbar=no,scrollbars=yes,titlebar=no,menubar=no,resizable=yes,width=640,height=480,directories=no,location=no\u0027); return false;\" rel=\"nofollow\"\u003e\u003cimg src=\"/templates/theme509/images/pdf_button.png\" alt=\"PDF\" /\u003e\u003c/a\u003e \u003c/td\u003e\r\n \u003ctd align=\"right\" width=\"100%\" class=\"buttonheading\"\u003e\u003ca href=\"/index.php?view=article&amp;catid=43%3Atechgeneral&amp;id=64%3Atechnical-arts-ministry&amp;tmpl=component&amp;print=1&amp;layout=default&amp;page=&amp;option=com_content&amp;Itemid=80\" title=\"Print\" onclick=\"window.open(this.href,\u0027win2\u0027,\u0027status=no,toolbar=no,scrollbars=yes,titlebar=no,menubar=no,resizable=yes,width=640,height=480,directories=no,location=no\u0027); return false;\" rel=\"nofollow\"\u003e\u003cimg src=\"/templates/theme509/images/printButton.png\" alt=\"Print\" /\u003e\u003c/a\u003e \u003c/td\u003e\r\n \u003ctd align=\"right\" width=\"100%\" class=\"buttonheading\"\u003e\u003ca href=\"/index.php?option=com_mailto&amp;tmpl=component&amp;link=aHR0cDovL3d3dy5yb2NrcG9pbnRlLmNhL3RlY2hnZW5lcmFsL3RlY2huaWNhbC1hcnRzLW1pbmlzdHJ5\" title=\"E-mail\" onclick=\"window.open(this.href,\u0027win2\u0027,\u0027width=400,height=350,menubar=yes,resizable=yes\u0027); return false;\"\u003e\u003cimg src=\"/templates/theme509/images/emailButton.png\" alt=\"E-mail\" /\u003e\u003c/a\u003e \u003c/td\u003e\r\n \u003c/tr\u003e\r\n \u003c/table\u003e\r\n \u003c/div\u003e\u003c/td\u003e\r\n \u003c/tr\u003e\r\n \u003c/table\u003e\r\n\u003c/div\u003e\r\n\r\n\u003cdiv class=\"wrapper1-border\"\u003e\r\n \t\u003cdiv class=\"wrapper1-bg clear\"\u003e\r\n \t\u003cdiv class=\"article-text-indent\"\u003e\r\n \u003cdiv class=\"clear\"\u003e\r\n \u003ctable class=\"contentpaneopen\"\u003e\r\n \u003ctr\u003e\r\n \u003ctd valign=\"top\"\u003e \u003c!-- KA Like and Share Button Start --\u003e\u003cdiv class=\"kasocialplugin\"\u003e\u003cspan class=\"kafblike\"\u003e\u003cfb:like href=\"http://www.rockpointe.ca/techgeneral/technical-arts-ministry\" layout=\"button_count\" show_faces=\"false\" width=\"\" action=\"like\" font=\"\" style=\"height:px;\" colorscheme=\"light\"\u003e\u003c/fb:like\u003e\u003c/span\u003e\u003cspan class=\"kafbshare\"\u003e\u003cfb:share-button class=\"url\" href=\"http://www.rockpointe.ca/techgeneral/technical-arts-ministry\" type=\"icon_link\"\u003e\u003c/fb:share-button\u003e\u003c/span\u003e\u003c/div\u003e\u003c!-- KA Like and Share Button End--\u003e\u003cp style=\"text-align: justify;\"\u003e\u003cimg style=\"margin: 10px; float: left; border: #000000 2px solid;\" src=\"/images/stories/Tech/Bowridge_MediaShout.jpg\" alt=\"Bowridge_MediaShout\" width=\"252\" height=\"191\" /\u003e\u003c/p\u003e\r\n\u003cp style=\"text-align: justify;\"\u003eTechnical Arts Ministries at RockPointe Church exist to facilitate creative communication through the use of audio, video, lighting, and presentation technologies.&nbsp; We serve in teams in order to help our congregations see, hear and experience dynamic worship and life-connected teaching each weekend.\u003c/p\u003e\r\n\u003cp style=\"text-align: justify;\"\u003eTechnical Arts Ministries is a team of audio techs, camera operators, video directors, lighting people&nbsp;and computer media people. As you serve in each of these roles you will facilitate inspired worship and community across all RockPointe locations. Training is provided a minimum of four times a year and you will be mentored by guest professionals in this field.\u003c/p\u003e\r\n\u003cp style=\"text-align: justify;\"\u003e\u003cimg style=\"border: 2px solid #000000; margin: 10px; float: right;\" src=\"/images/stories/Tech/Ryan_Mann.jpg\" alt=\"Ryan_Mann\" width=\"250\" height=\"187\" /\u003e\u003c/p\u003e\r\n\u003cp style=\"text-align: justify;\"\u003eTechnical Arts Ministries wants to grow resourceful servants and develop a multi-generational team of creative volunteers. Our teams will also have the opportunity to support Children’s Ministry, Youth Ministry, and rental clients’ technical needs.\u003c/p\u003e\r\n\u003cp style=\"text-align: justify;\"\u003eIf you are gifted in ministries that serve to help and enable others, this could be a great serve for you!\u003c/p\u003e\r\n\u003cp style=\"text-align: justify;\"\u003eContact Chase Florell at \n \u003cscript language=\u0027JavaScript\u0027 type=\u0027text/javascript\u0027\u003e\n \u003c!--\n var prefix = \u0027m&#97;&#105;lt&#111;:\u0027;\n var suffix = \u0027\u0027;\n var attribs = \u0027\u0027;\n var path = \u0027hr\u0027 + \u0027ef\u0027 + \u0027=\u0027;\n var addy65240 = \u0027cfl&#111;r&#101;ll\u0027 + \u0027&#64;\u0027;\n addy65240 = addy65240 + \u0027r&#111;ckp&#111;&#105;nt&#101;\u0027 + \u0027&#46;\u0027 + \u0027c&#97;\u0027;\n document.write( \u0027\u003ca \u0027 + path + \u0027\\\u0027\u0027 + prefix + addy65240 + suffix + \u0027\\\u0027\u0027 + attribs + \u0027\u003e\u0027 );\n document.write( addy65240 );\n document.write( \u0027\u003c\\/a\u003e\u0027 );\n //--\u003e\n \u003c/script\u003e\u003cscript language=\u0027JavaScript\u0027 type=\u0027text/javascript\u0027\u003e\n \u003c!--\n document.write( \u0027\u003cspan style=\\\u0027display: none;\\\u0027\u003e\u0027 );\n //--\u003e\n \u003c/script\u003eThis e-mail address is being protected from spambots. You need JavaScript enabled to view it\n \u003cscript language=\u0027JavaScript\u0027 type=\u0027text/javascript\u0027\u003e\n \u003c!--\n document.write( \u0027\u003c/\u0027 );\n document.write( \u0027span\u003e\u0027 );\n //--\u003e\n \u003c/script\u003e or (403) 851-0011 if you\u0027d like more information on our Audio Visual Tech Ministry, or are interested in becoming involved as a volunteer.\u003c/p\u003e\r\n\u003cp style=\"text-align: justify;\"\u003e \u003c/p\u003e\r\r \u003c/td\u003e\r\n \u003c/tr\u003e\r\n \u003c/table\u003e\r\n \u003c/div\u003e\r\n \u003c/div\u003e\r\n \u003c/div\u003e\r\n\u003c/div\u003e\r\n\u003cdiv class=\"article-separator-indent\"\u003e\u003cspan class=\"article_separator\"\u003e&nbsp;\u003c/span\u003e\u003c/div\u003e\r\n \n\u003cdiv id=\"fb-root\"\u003e\u003c/div\u003e\r\n\u003cscript\u003e\r\nwindow.fbAsyncInit = function() { FB.init({appId: \u0027132837736755646\u0027, status: true, cookie: true, xfbml: true}); };\r\n(function() { var e = document.createElement(\u0027script\u0027);\r\ne.type = \u0027text/javascript\u0027;\r\ne.src = document.location.protocol + \u0027//connect.facebook.net/en_GB/all.js\u0027;\r\ne.async = true;\r\ndocument.getElementById(\u0027fb-root\u0027).appendChild(e);\r\n}());\r\n\u003c/script\u003e\u003c/body\u003e\n\u003c/html\u003e"},"success":true});Any reason why I would be getting this?

rockinthesixstring
22 Jun 2011, 7:57 AM
^

rockinthesixstring
23 Jun 2011, 6:40 AM
I really can't find much (any) information on this cryptic error. I'm basically hung up not being able to continue...

jmclem
23 Jun 2011, 7:03 AM
are you sure that the way you define the fields in your model is supported? I am only aware of


fields: [
{name: "foo", type: "string"},
{name: "bar", type: "int"}
]
Jean-Marie.

rockinthesixstring
23 Jun 2011, 7:25 AM
nope, I've gotten rid of the error by fixing my JSON in my webservice.

Length undefined was because I was requesting the wrong "root" from my JSON feed.