Skip to content

Commit

Permalink
AutoSuggest: adding useCache
Browse files Browse the repository at this point in the history
  • Loading branch information
jakearchibald committed Sep 25, 2009
1 parent 57e8afd commit a744d30
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
3 changes: 2 additions & 1 deletion manualtests/widgets/autosuggest/index.html
Expand Up @@ -97,7 +97,8 @@ <h2>Autosuggest with minimum input length, and completion</h2>
complete: true,
activeOnShow: false,
delim: " ",
theme: urlOpts.theme
theme: urlOpts.theme,
useCache: true
}
).loadData();

Expand Down
6 changes: 6 additions & 0 deletions src/widgets/autosuggest/autosuggest.js
Expand Up @@ -48,6 +48,7 @@
that._pendingRequest = glow.net.get(
url,
{
useCache: that.opts.useCache,
onLoad: function(r) {
var dataObject = (that.opts.parseData)? that.opts.parseData.apply(that, [r]) : eval(r.text());

Expand Down Expand Up @@ -604,6 +605,11 @@
single argument, an array of objects corresponding to the objects in
your data that are considered to match; expects you to return an array
of objects modified as you wish.
@param {Boolean} [opts.useCache=false] Allow results to cache when using a url dataSource
If false, a random number will be added to the URL to ensure the
results do not come from the browser's cache.
@param {Function} [opts.onItemSelect] Your own handler for the itemSelect event.
@param {Function} [opts.onDataLoad] Your own handler for the dataLoad event.
@param {Function} [opts.onDataError] Your own handler for the dataError event.
Expand Down

0 comments on commit a744d30

Please sign in to comment.