| Page 1 of 1 | [ 2 posts ] |
|
This post is about how AutoComplete is behaving when returned data from DataSource that has been extracted from an XML file.
I'm new to YUI, and I'm not clear about how DataSource's responseSchema works in terms of which bit gets passed back to AutoComplete. Perhaps someone can explain in terms of the following simple example. I have an XML file: Code: <bookers> <record> <lastName>Abacus</lastName> <extra> (Polly)</extra> </record> <record> <lastName>Billington</lastName> <extra> (Sam)</extra> </record> </bookers> and defined (where oDS is the Data Source) Code: oDS.responseSchema = { resultNode: 'record', fields: ['lastName', 'extra'] }; In the debug output I see DataSource instance0 Parsed XML data is {meta => {}, results => [{extra => (Polly), lastName => Abacus}, {extra => (Sam), lastName => Billington}]} But (if I type "b") only the lastName fields appear in the AutoComplete results container.. Abacus Billington Can anyone say exactly what the relationship is between the responseSchema and the results container? Thanks Peter |
Matt ParkerYUI Contributor
|
Hi,
The relationship is handled by AutoComplete - that's where you need to handle the data that DataSource is providing. responseSchema only tells the DataSource what to expect, where. Have a look at this: http://developer.yahoo.com/yui/autocomplete/#formatting - there's some examples there that you should be able to follow to get what you want. Matt |
| Page 1 of 1 | [ 2 posts ] |
| You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum |
© 2006-2013 Yahoo! Inc. All rights reserved.
All code on this site is licensed under the BSD License unless stated otherwise.
About This Site · Security Contact Info
Powered by phpBB® Forum Software © phpBB Group