View Full Version : Please Help Me - Suggest Example Using XML Reader

24 Apr 2009, 2:47 AM

I dont know how to filter out xml data.

I want to display the xml data while entering input in input box. I am using xml reader to read the xm data. Actually it display all the xml data.

It display lie forum search example template.

Can any one help me to solve this?

My xml file

<?xml version="1.0" encoding="UTF-8"?>
<records total="2">
<sonordaugof>Ram Naresh</sonordaugof>

<sonordaugof>Ram Naresh</sonordaugof>

<sonordaugof>Ram Naresh</sonordaugof>

<sonordaugof>Krishnan Shankar</sonordaugof>


when i type a in input it should display only arun, arun.

My js file

var store = new Ext.data.Store({

// load using HTTP
url: 'sample.xml',

// the return will be XML, so lets set up a reader
reader: new Ext.data.XmlReader({

record: 'user',
id: 'id'
,totalRecords: '@total'
}, [
{name: 'id', type: 'int'},
{name: 'firstName'},
{name: 'lastName'},
{name: 'class'},
{name: 'sec'},
{name: 'sonordaugof'}

// Custom rendering Template
var resultTpl = new Ext.XTemplate(
'<tpl for="."><div class="search-item">'
,'<h3><span>{id}{firstName} </span></h3>'
,'Son/Daughter of {sonordaugof}<br>',
'{class}' ,
'{sec} Section' ,

var search = new Ext.form.ComboBox({

store: store,
typeAhead: true,
loadingText: 'Searching...',
width: 570,
tpl: resultTpl,
applyTo: 'search',
itemSelector: 'div.search-item',
onSelect: function(record){ // override default onSelect to do redirect
window.location =

24 Apr 2009, 4:25 AM
40 posts and you don't know to use the code tags when posting?!