<?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>Dev411 Blog: Category yui</title>
    <link>http://www.dev411.com/blog/tag/yui</link>
    <language>en-us</language>
    <ttl>40</ttl>
    <description>John Wang on Technology</description>
    <item>
      <title>Comparing CPAN Modules with YUI DataTable</title>
      <description>&lt;p&gt;There is a lot of choice on the CPAN for open source Perl libraries and sometimes it's difficult to get an idea of how modules compare to each other. &lt;a href="http://ratings.cpan.org"&gt;CPAN Ratings&lt;/a&gt; is a good source of reviews but it's not convenient to compare one module with another. To provide a partial solution, I whipped up a quick &lt;a href="http://www.dev411.com/perl/cpancompare"&gt;CPAN Compare&lt;/a&gt; page which will pull the CPAN Ratings from a number of modules and summarize them for you.&lt;/p&gt;

&lt;div style="text-align:center;margin:1em 0 1em 0"&gt;&lt;a href="/perl/cpancompare/"&gt;&lt;img alt="CPAN Compare Modules" src="/images/articles/cpan_compare_ss_400x.png" style="border:0" /&gt;&lt;/a&gt;&lt;/div&gt;

&lt;p&gt;I decided to use &lt;a href="http://developer.yahoo.com/yui/datatable/"&gt;YUI DataTable&lt;/a&gt; for this. I've heard good things about YUI so I decided to give it a try. Getting the example code to work off of the Yahoo website almost as straight forward as say using Scriptaculous demos but it was faster than working with Dojo in the early days. The nice thing about the DataTable is that it takes a JavaScript array which can be populated using server-side JSON generated code. I used JSON::XS for this.&lt;/p&gt;

&lt;p&gt;YUI DataTable has a nice sorting feature and it can sort on text, numbers, dates, etc. However, it does not seem to be able to sort on visual information only so if you include HTML markup, that will be used for sorting as well. To get around this I used standard text sorting and customized the title fields to assist in the sorting. For example, in a link, I start with &amp;lt;a title=" instead of &amp;lt;a href=" because title is arbitrary and can be used to mirror the InnerHTML. For numbers a text sort will have 25 come before 4 so I added leading zeros to numbers using sprintf and put them in the title attribute as well.&lt;/p&gt;

&lt;p&gt;A few Perl modules and the Logo Creator website made this easy to set up. YUI DataTable has a nice default CSS so I just left that as is.&lt;/p&gt;

&lt;p&gt;Note: YUI DataTable is convenient if you just drop in a Perl data structure and have it generate the HTML and JS for you. This script uses 3 DataTables (ratings, popular and recent) so I wrote a Perl wrapper for YUI which takes a hashref and generates the client code, extracting the fields from the column definitions. This works because YUI does not require the HTML table to be built beforehand. By not having an underlying table, it's faster to get running but also won't fallback as nicely for people who aren't running JS (8% of users?). As an alternative, jQuery has a &lt;a href="http://ideamill.synaptrixgroup.com/jquery/tablefilter/tabletest.htm"&gt;couple&lt;/a&gt; of &lt;a href="http://tablesorter.com/docs/#Demo"&gt;add ons&lt;/a&gt; which work by enhancing an existing HTML table. jQuery has some nice syntax but I haven't gotten around to using it yet. Perhaps it's worth a look.&lt;/P&gt;</description>
      <pubDate>Fri, 09 Nov 2007 00:09:00 -0600</pubDate>
      <guid isPermaLink="false">urn:uuid:ae818063-2322-4837-b2a9-4bed5ff26768</guid>
      <author>John Wang</author>
      <link>http://www.dev411.com/blog/2007/11/09/comparing-cpan-modules-with-yui-datatable</link>
      <category>yui</category>
      <category>perl</category>
    </item>
    <item>
      <title>Yahoo! UI (YUI) cheat sheets as wallpaper</title>
      <description>&lt;p&gt;Yahoo! provides a number of &lt;a href="http://developer.yahoo.com/yui/#cheatsheets"&gt;cheat sheets for their YUI library widgets&lt;/a&gt; however these are in PDF format and not usable as wallpaper. PDF is great as a transport format because you can provide one version for everyone, however transforming it makes it more appealing for actual use. I prefer cheat sheets in standard image formats that can used as wallpaper, espcially useful with virtual desktops.&lt;/p&gt;

&lt;div style="text-align:center"&gt;&lt;img src="/images/articles/200607/yui-cheat-sheets-0.10.gif" alt="Yahoo UI! Cheat Sheets" /&gt;&lt;/div&gt;

&lt;p&gt;Here are the YUI 0.11 cheat sheets converted to PNG images of various sizes. Let me know if any other sizes would be useful.&lt;/p&gt;

&lt;div id="yuicheatsheets"&gt;
&lt;table&gt;&lt;tr&gt;
&lt;th&gt;Animation&lt;/th&gt;
&lt;td&gt;&lt;a href="/cheatsheets/sheets/YUI_Animation_0.11_1400x1050.png"&gt;1400x1050&lt;/a&gt;
&lt;a href="/cheatsheets/sheets/YUI_Animation_0.11_1280x960.png"&gt;1280x960&lt;/a&gt;
&lt;a href="/cheatsheets/sheets/YUI_Animation_0.11_1165x900.png"&gt;1165x900&lt;/a&gt;
&lt;a href="/cheatsheets/sheets/YUI_Animation_0.11_1024x768.png"&gt;1024x768&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;tr&gt;
&lt;th&gt;Calendar&lt;/th&gt;
&lt;td&gt;&lt;a href="/cheatsheets/sheets/YUI_Calendar_0.11_1400x1050.png"&gt;1400x1050&lt;/a&gt;
&lt;a href="/cheatsheets/sheets/YUI_Calendar_0.11_1280x960.png"&gt;1280x960&lt;/a&gt;
&lt;a href="/cheatsheets/sheets/YUI_Calendar_0.11_1165x900.png"&gt;1165x900&lt;/a&gt;
&lt;a href="/cheatsheets/sheets/YUI_Calendar_0.11_1024x768.png"&gt;1024x768&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;tr&gt;
&lt;th&gt;Connection Manager&lt;/th&gt;
&lt;td&gt;&lt;a href="/cheatsheets/sheets/YUI_Connection_0.11_1400x1050.png"&gt;1400x1050&lt;/a&gt;
&lt;a href="/cheatsheets/sheets/YUI_Connection_0.11_1280x960.png"&gt;1280x960&lt;/a&gt;
&lt;a href="/cheatsheets/sheets/YUI_Connection_0.11_1165x900.png"&gt;1165x900&lt;/a&gt;
&lt;a href="/cheatsheets/sheets/YUI_Connection_0.11_1024x768.png"&gt;1024x768&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;tr&gt;
&lt;th&gt;Dom Collection&lt;/th&gt;
&lt;td&gt;&lt;a href="/cheatsheets/sheets/YUI_Dom_0.11_1400x1050.png"&gt;1400x1050&lt;/a&gt;
&lt;a href="/cheatsheets/sheets/YUI_Dom_0.11_1280x960.png"&gt;1280x960&lt;/a&gt;
&lt;a href="/cheatsheets/sheets/YUI_Dom_0.11_1165x900.png"&gt;1165x900&lt;/a&gt;
&lt;a href="/cheatsheets/sheets/YUI_Dom_0.11_1024x768.png"&gt;1024x768&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;tr&gt;
&lt;th&gt;Drag &amp;amp; Drop&lt;/th&gt;
&lt;td&gt;&lt;a href="/cheatsheets/sheets/YUI_Drag-and-Drop_0.11_1400x1050.png"&gt;1400x1050&lt;/a&gt;
&lt;a href="/cheatsheets/sheets/YUI_Drag-and-Drop_0.11_1280x960.png"&gt;1280x960&lt;/a&gt;
&lt;a href="/cheatsheets/sheets/YUI_Drag-and-Drop_0.11_1165x900.png"&gt;1165x900&lt;/a&gt;
&lt;a href="/cheatsheets/sheets/YUI_Drag-and-Drop_0.11_1024x768.png"&gt;1024x768&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;tr&gt;
&lt;th&gt;Event Utility &amp;amp; Custom Event&lt;/th&gt;
&lt;td&gt;&lt;a href="/cheatsheets/sheets/YUI_Event_0.11_1400x1050.png"&gt;1400x1050&lt;/a&gt;
&lt;a href="/cheatsheets/sheets/YUI_Event_0.11_1280x960.png"&gt;1280x960&lt;/a&gt;
&lt;a href="/cheatsheets/sheets/YUI_Event_0.11_1165x900.png"&gt;1165x900&lt;/a&gt;
&lt;a href="/cheatsheets/sheets/YUI_Event_0.11_1024x768.png"&gt;1024x768&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;tr&gt;
&lt;th&gt;Logger&lt;/th&gt;
&lt;td&gt;&lt;a href="/cheatsheets/sheets/YUI_Logger_0.11_1400x1050.png"&gt;1400x1050&lt;/a&gt;
&lt;a href="/cheatsheets/sheets/YUI_Logger_0.11_1280x960.png"&gt;1280x960&lt;/a&gt;
&lt;a href="/cheatsheets/sheets/YUI_Logger_0.11_1165x900.png"&gt;1165x900&lt;/a&gt;
&lt;a href="/cheatsheets/sheets/YUI_Logger_0.11_1024x768.png"&gt;1024x768&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;tr&gt;
&lt;th&gt;Slider&lt;/th&gt;
&lt;td&gt;&lt;a href="/cheatsheets/sheets/YUI_Slider_0.11_1400x1050.png"&gt;1400x1050&lt;/a&gt;
&lt;a href="/cheatsheets/sheets/YUI_Slider_0.11_1280x960.png"&gt;1280x960&lt;/a&gt;
&lt;a href="/cheatsheets/sheets/YUI_Slider_0.11_1165x900.png"&gt;1165x900&lt;/a&gt;
&lt;a href="/cheatsheets/sheets/YUI_Slider_0.11_1024x768.png"&gt;1024x768&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;tr&gt;
&lt;th&gt;TreeView&lt;/th&gt;
&lt;td&gt;&lt;a href="/cheatsheets/sheets/YUI_TreeView_0.11_1400x1050.png"&gt;1400x1050&lt;/a&gt;
&lt;a href="/cheatsheets/sheets/YUI_TreeView_0.11_1280x960.png"&gt;1280x960&lt;/a&gt;
&lt;a href="/cheatsheets/sheets/YUI_TreeView_0.11_1165x900.png"&gt;1165x900&lt;/a&gt;
&lt;a href="/cheatsheets/sheets/YUI_TreeView_0.11_1024x768.png"&gt;1024x768&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;

</description>
      <pubDate>Tue, 25 Jul 2006 03:12:00 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:d0a32f2b7c403b46ce07f6dcd8a0d7de</guid>
      <author>John Wang</author>
      <link>http://www.dev411.com/blog/2006/07/25/yahoo-ui-yui-cheat-sheets-as-wallpaper</link>
      <category>yui</category>
      <category>ajax</category>
    </item>
    <item>
      <title>Autocomplete Survey</title>
      <description>&lt;p&gt;Here are some screen shots of various autocomplete effects in action to show what people are doing. The images and names above the images have links to the relevant sites with the domain name shown. I'll add more screen shots here as I get them. Let me know if there are any other toolkits demos or interesting implementations.&lt;/p&gt;

&lt;p&gt;Here are some observations:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;All of the screen shots and links are for toolkits except for Google which is just shown as an example.&lt;/li&gt;
&lt;li&gt;The jQuery and Scriptaculous demos do not automatically display "autocomplete" text in the input element.&lt;/li&gt;
&lt;li&gt;All of the demos, except Dojo, include text that will end up in the input field as well as extra display text that will not.&lt;/li&gt;
&lt;li&gt;Where both simple and customized demos are available, the customized one is used for the screen shot.&lt;/li&gt;
&lt;li&gt;Del.icio.us also has nice variable horizontal location/width autocomplete for tags that I don't have a screen shot for atm. Gmail also has a nice autocomplete that isn't shown.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The observations are just for the particular demos available. The libraries may have the ability to be configured in additional ways.&lt;/p&gt;

&lt;div id="article_ac" style="text-align:center"&gt;
&lt;table class="article_ac"&gt;&lt;tr&gt;
  &lt;td style="vertical-align:top"&gt;
  
&lt;div class="ac_img_wrap"&gt;
&lt;a href="http://download.dojotoolkit.org/release-0.3.0/dojo-0.3.0-widget/tests/widget/test_remote_ComboBox.html"&gt;&lt;strong&gt;Dojo&lt;/strong&gt; (dojotoolkit.org)&lt;/a&gt;
&lt;br /&gt;
&lt;a href="http://download.dojotoolkit.org/release-0.3.0/dojo-0.3.0-widget/tests/widget/test_remote_ComboBox.html"&gt;&lt;img class="img_wrap" alt="dojo autocomplete" src="/images/articles/200607/autocomplete_dojo_200.png" /&gt;&lt;/a&gt;
&lt;br /&gt;
(&lt;a href="/images/articles/200607/autocomplete_dojo.png"&gt;fullsize screen shot&lt;/a&gt;)
&lt;/div&gt;

&lt;div class="ac_img_wrap"&gt;
&lt;a href="http://proj.jquery.com/discuss/2006-July/003050/"&gt;&lt;strong&gt;jQuery&lt;/strong&gt; (jquery.com)&lt;/a&gt;
&lt;br /&gt;
&lt;a href="http://proj.jquery.com/discuss/2006-July/003050/"&gt;&lt;img class="img_wrap" alt="jquery autocomplete" src="/images/articles/200607/autocomplete_jquery_200.png" /&gt;&lt;/a&gt;
&lt;br /&gt;
(&lt;a href="/images/articles/200607/autocomplete_jquery_orig.png"&gt;fullsize screen shot&lt;/a&gt;)
&lt;/div&gt;

&lt;div class="ac_img_wrap"&gt;
&lt;a href="http://developer.yahoo.com/yui/autocomplete/"&gt;&lt;strong&gt;Yahoo UI&lt;/strong&gt; (yahoo.com)&lt;/a&gt;
&lt;br /&gt;
&lt;a href="http://developer.yahoo.com/yui/autocomplete/"&gt;&lt;img  class="img_wrap" alt="yahoo ui autocomplete" src="/images/articles/200607/autocomplete_yahooui_200.png" /&gt;&lt;/a&gt;
&lt;br /&gt;
(&lt;a href="/images/articles/200607/autocomplete_yahooui.png"&gt;fullsize screen shot&lt;/a&gt;)
&lt;/div&gt;

  &lt;/td&gt;&lt;td style="vertical-align:top"&gt;

&lt;div class="ac_img_wrap"&gt;
&lt;a href="http://labs.google.com/suggest/"&gt;&lt;strong&gt;Google&lt;/strong&gt; (google.com)&lt;/a&gt;
&lt;br /&gt;
&lt;a href="http://labs.google.com/suggest/"&gt;&lt;img class="img_wrap" alt="google suggest autocomplete" src="/images/articles/200607/autocomplete_google_200.png" /&gt;&lt;/a&gt;
&lt;br /&gt;
(&lt;a href="/images/articles/200607/autocomplete_google.png"&gt;fullsize screen shot&lt;/a&gt;)
&lt;/div&gt;

&lt;div class="ac_img_wrap"&gt;
&lt;a href="http://demo.script.aculo.us/ajax/autocompleter_customized"&gt;&lt;strong&gt;Scriptaculous&lt;/strong&gt; (script.aculo.us)&lt;/a&gt;
&lt;br /&gt;
&lt;a href="http://demo.script.aculo.us/ajax/autocompleter_customized"&gt;&lt;img class="img_wrap" alt="scriptaculous autocomplete" src="/images/articles/200607/autocomplete_scriptaculous_200.png" /&gt;&lt;/a&gt;
&lt;br /&gt;
(&lt;a href="/images/articles/200607/autocomplete_scriptaculous.png"&gt;fullsize screen shot&lt;/a&gt;)
&lt;/div&gt;
  
  &lt;/td&gt;
&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;

&lt;p&gt;NOTE: The jQuery screen shot has been edited to size it better from the demo page: (a) the number of results was reduced and (b) the width has been reduced because there's a lot of blank space in the demo. The &lt;a href="/images/articles/200607/autocomplete_jquery_orig.png"&gt;original jQuery screen shot&lt;/a&gt; is also available.&lt;/p&gt;

&lt;p&gt;UPDATE: CAPXOUS has an interesting paged autocomplete variation which adds Next and Prev links when applicable. The one minor issue I ran into when using this is that it would switch location (above/below the input) if it was near a browser edge and the number of items changed as shown below. I found this a bit disconcerting. I wonder if there's a way to making it always used the side for the larger list? CAPXOUS can also show info that's searched on but not shown but this was less interesting than the paging. One final note, unlike the other JS libraries listed above which are free open source software (FOSS), CAPXOUS is commecial requires a license fee. Pretty interesting idea.&lt;/p&gt;

&lt;table class="article_ac"&gt;&lt;tr&gt;
  &lt;td style="vertical-align:top;text-align:center"&gt;
  
&lt;div class="ac_img_wrap"&gt;
&lt;a href="http://capxous.com/"&gt;&lt;strong&gt;CAPXOUS&lt;/strong&gt; (capxious.com)&lt;/a&gt;
&lt;br /&gt;
&lt;a href="http://capxous.com/"&gt;&lt;img class="img_wrap" alt="capxous autocomplete" src="/images/articles/200607/autocomplete_capxous.png" /&gt;&lt;/a&gt;
&lt;br /&gt;
(&lt;a href="/images/articles/200607/autocomplete_capxious.png"&gt;fullsize screen shot&lt;/a&gt;)
&lt;/div&gt;
  &lt;/td&gt;
&lt;/tr&gt;&lt;/table&gt;

</description>
      <pubDate>Mon, 17 Jul 2006 23:15:00 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:6cd5c46165d0c7e0eb3ef4a70efb0344</guid>
      <author>John Wang</author>
      <link>http://www.dev411.com/blog/2006/07/17/autocomplete-survey</link>
      <category>yui</category>
      <category>jquery</category>
      <category>dojo</category>
      <category>google</category>
      <category>autocomplete</category>
      <category>ajax</category>
      <category>scriptaculous</category>
    </item>
  </channel>
</rss>
