PDA

View Full Version : highlighting the search phrase in search results



vn_beth
21 Apr 2008, 10:36 AM
Anyone know how I can highlight the search term in my search results?

Say for instance I'm searching for the term "the " (yeah, I know that's bad, but my datasource is school names in New York, so it actually returns about 20 results), and I want my search results to have the "the " bolded/

I am using a template:


var resultTpl = new Ext.XTemplate(
'<tpl for="."><div class="search-item">',
'{Formal_Name}<br />{City}&nbsp;{Mascot_Name}',
'</div></tpl>'
);

So how do I get the "the " part of Formal_Name bolded?

Thanks in advance!

21 Apr 2008, 10:38 AM
this is how i did it: http://tdg-i.com/20/custom-combobox-query-results-via-xtemplates

vn_beth
21 Apr 2008, 12:11 PM
Thanks! Most excellent.