<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="/stylesheets/rss.css" type="text/css"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">
  <channel>
    <title>I.NFECTIO.US: Extending script.aculo.us</title>
    <link>http://i.nfectio.us/articles/2006/02/16/extending-script-aculo-us</link>
    <language>en-us</language>
    <ttl>40</ttl>
    <description>"Nothing in life is worth doing if you have no life while doing it"</description>
    <item>
      <title>Extending script.aculo.us</title>
      <description>&lt;p&gt;One of the great features of &lt;a href="http://www.rubyonrails.org/"&gt;Rails&lt;/a&gt; is its plugin system. It allows you to add new functionality to the framework without modifying the original source. On my current project, I had a need to create a CachingAutoCompleter and I wanted to do it within Rails. 
&lt;/p&gt;&lt;br /&gt;
&lt;p&gt;Rails has a method that will work just fine, &lt;a href="http://api.rubyonrails.org/classes/ActionView/Helpers/JavaScriptMacrosHelper.html#M000377"&gt;text_field_with_auto_complete&lt;/a&gt;. The problem lies in the fact that this method creates an Ajax.Autocompleter, whereas I need an AutoComplete object with my caching functionality. I could modify the &lt;a href="http://script.aculo.us/"&gt;script.aculo.us&lt;/a&gt; source for Ajax.Autocompletor and add my caching layer but surely there's gotta be a better way, something akin to the Rails plugin system.&lt;/p&gt;
&lt;br /&gt;
&lt;p&gt;
Click the image below to watch a screencast (7MB) of how I accomplished this goal.
&lt;/p&gt;&lt;br /&gt;
&lt;p&gt;
&lt;a href="/extending/extend.html"&gt;&lt;img src="/extending/extending.gif" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;br /&gt;
&lt;p&gt;
You can download the source of the CachingAutoCompleter &lt;a href="/extending/cac.zip"&gt;here&lt;/a&gt;.&lt;/p&gt;</description>
      <pubDate>Thu, 16 Feb 2006 02:23:00 -0800</pubDate>
      <guid isPermaLink="false">urn:uuid:2b2d51799d9a0a77d4214f654178cc59</guid>
      <author>Bob Silva</author>
      <link>http://i.nfectio.us/articles/2006/02/16/extending-script-aculo-us</link>
      <category>Ruby on Rails</category>
    </item>
    <item>
      <title>"Extending script.aculo.us" by ricardo.pacheco.name</title>
      <description>Bob:
It was a very interesting Videocast!!&lt;br /&gt;
There are some cases in wich your caching functionality can be very useful, if the full list of options is displayed.&lt;br /&gt;
Nevertheless there may be some fields where the number of matches returned by the database are too big. For those cases a query with "limit" makes sence.&lt;br /&gt;
In the same data entry screen there may be the two types of fields. I think that in those cases the Ajax.Autocompleter.prototype.cache would be very usefull.&lt;br /&gt;
I think that you could complement your article to explain how to enable this functionality for some fields and disable it for others.&lt;br /&gt;

Thanks,&lt;br /&gt;Ricardo</description>
      <pubDate>Wed, 19 Jul 2006 09:03:03 -0700</pubDate>
      <guid isPermaLink="false">urn:uuid:fb876926-bd56-4db7-9582-aaaafaec5da5</guid>
      <link>http://i.nfectio.us/articles/2006/02/16/extending-script-aculo-us#comment-32</link>
    </item>
  </channel>
</rss>
