PDA

View Full Version : XML Searching in 3.x? something like livesearch?



pschramm
11 Jul 2013, 8:35 AM
I have some XML coming from a remote server that I need to implement in a filtered/searchable way for a web form. I saw the extJS livesearch api that would work nicely but I'm a version behind in 3.x.. So I though maybe I could accomplish this in another way?

Here is what my XML looks like..


<SearchText>
<applicationname>Application1</applicationname>
<searchvalue>some search term</searchvalue>
</SearchText>
<SearchText>
<applicationname>VIM Application1</applicationname>
<searchvalue>some other search term</searchvalue>
</SearchText>
<SearchText>
<applicationname>VIM Application1</applicationname>
<searchvalue>more search terms</searchvalue>
</SearchText>

Ultimately I'm doing a lookup into this structure by "applicationname" from another combobox and I want text field to search all the "searchvalues" for that set of application and return the application name if the search term exists there -

Anything is appreciated -

thanks again

mitchellsimoens
13 Jul 2013, 5:35 AM
How are you loading the XML? In a store? If so then you can filter the store and it will filter out the records that don't match.

pschramm
14 Jul 2013, 9:06 PM
Yes..

I have the following.. I see the query get invoked and I return XML .. but nothing ever renders in the combo.. I just see loading..

Is is possible to pass an ID to this URL from another combo?

many thanks -



var DataStore = new Ext.data.XmlStore({
url: '${applicationProductSearch}',
root: 'application',
autoLoad: true,
fields: ['applicationname', 'applicationrecid']
});

//testing Combo component
var applicationProductSearchField = new Ext.form.ComboBox({
store: DataStore,
//testing on account for now
transform:'applicationSearchSelect',
displayField: 'applicationname',
mode: 'remote',
triggerAction: 'all',
selectOnFocus: true,
typeAhead: true,
minChars: 1
});

<applicationlist>
<application>
<applicationrecid>496E7137EEE249EF92A4D405FDBA071E</applicationrecid>
<applicationname>(Delivery Server)</applicationname>
<applicationversion>
<applicationrecid>496E7137EEE249EF92A4D405FDBA071E</applicationrecid>
<ApplicationVersion>10</ApplicationVersion>
</applicationversion>
<applicationversion>
<applicationrecid>496E7137EEE249EF92A4D405FDBA071E</applicationrecid>
<ApplicationVersion>9.0</ApplicationVersion>
</applicationversion>
</application>
<application>
<applicationrecid>DBD1369CC66F48C89505A97D364E6182</applicationrecid>
<applicationname>(Management Server)</applicationname>
<applicationversion>
<applicationrecid>DBD1369CC66F48C89505A97D364E6182</applicationrecid>
<ApplicationVersion>10</ApplicationVersion>
</applicationversion>
</application>
</applicationlist>