View Full Version : Read Data from XML to make a Click able List?

19 Oct 2010, 6:31 AM
I want to make a simple clickable list which get data from an XML file, but I dont know why it doesn't work...I haven't done anything with Sencha before.
I get an error like: "Uncaught TypeError: Cannot call method 'indexOf' of undefined" from debug sencha library????
Could you please help me to find out what's wrong with it?

Here is the code:

// JavaScript Document


//Get data from xml**********************************

var store = new Ext.data.XmlStore({
// store configs
autoLoad : true,
storeId: 'myStore',
url: 'feed.xml', // automatically configures a HttpProxy
record: 'Item',
idPath: 'id',

fields: [
name: 'id',
mapping: 'id'
name: 'title',
mapping: 'title'

//SHow in Listview******************************
var list = new Ext.List({
floating: true,
singleSelect: true,
store: list, //cteo to store
centered: true,

listeners: {
"itemtap": function(list, index, item, e) {


//Show in a panel*******************************
var panel = new Ext.Panel({
fullscreen: true,
title:'Simple ListView (0 items selected)',
items: list

And here is the XML file:

<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
<title>Ajax and XUL</title>
<title>News of today</title>