<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Information Technology Management &#38; Development &#187; extjs</title>
	<atom:link href="http://blogs.yellowfish.biz/tag/extjs/feed/" rel="self" type="application/rss+xml" />
	<link>http://blogs.yellowfish.biz</link>
	<description>IT Consulting, Infrastructure, Software &#38; Voip Phone Systems</description>
	<lastBuildDate>Tue, 27 Jul 2010 20:04:04 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.5</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Injecting Traits into Javascript Objects</title>
		<link>http://blogs.yellowfish.biz/2009/injecting-traits-into-javascript-objects/</link>
		<comments>http://blogs.yellowfish.biz/2009/injecting-traits-into-javascript-objects/#comments</comments>
		<pubDate>Wed, 30 Sep 2009 17:01:24 +0000</pubDate>
		<dc:creator>Praveen Ray</dc:creator>
				<category><![CDATA[Web Applications / User Interface Design]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[extjs]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://blogs.yellowfish.biz/?p=234</guid>
		<description><![CDATA[Duplication is the mother of all evil in programming. Remaining DRY at all costs should be your goal at all times. A pattern repeats itself one time and your code complexity goes up exponentially.
One great way to DRY up your code is via Traits. Traits are functional equivalent of base classes where you can collect [...]]]></description>
			<content:encoded><![CDATA[<p>Duplication is the mother of all evil in programming. Remaining DRY at all costs should be your goal at all times. A pattern repeats itself one time and your code complexity goes up exponentially.<br />
One great way to DRY up your code is via Traits. Traits are functional equivalent of base classes where you can collect most often used functions and inject these Traits into your objects. Here&#8217;s one simple way to do it in Javascript (using <a href="http://www.extjs.com">extjs</a> here):</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">MyTrait <span style="color: #339933;">=</span> <span style="color: #009900;">&#123;</span>
   xhr<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>config<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #000066; font-weight: bold;">return</span> Ext.<span style="color: #660066;">Ajax</span>.<span style="color: #660066;">request</span><span style="color: #009900;">&#40;</span>config<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
   submit<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>basic_form<span style="color: #339933;">,</span>config<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                <span style="color: #006600; font-style: italic;">//perform some checks on config </span>
               <span style="color: #006600; font-style: italic;">// and call basic_form.submit </span>
   <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
   <span style="color: #006600; font-style: italic;">//...add more utility functions</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #003366; font-weight: bold;">function</span> MyGrid<span style="color: #009900;">&#40;</span>config<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>MyGrid.<span style="color: #660066;">superclass</span>.<span style="color: #660066;">constructor</span>.<span style="color: #660066;">call</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #339933;">,</span>config<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#125;</span>
Ext.<span style="color: #660066;">extend</span><span style="color: #009900;">&#40;</span>MyGrid<span style="color: #339933;">,</span> Ext.<span style="color: #660066;">grid</span>.<span style="color: #660066;">GridPanel</span><span style="color: #339933;">,</span> MyTrait<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://blogs.yellowfish.biz/2009/injecting-traits-into-javascript-objects/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Clickable links within Extjs grid cells</title>
		<link>http://blogs.yellowfish.biz/2009/extjs-links-in-grid-cells/</link>
		<comments>http://blogs.yellowfish.biz/2009/extjs-links-in-grid-cells/#comments</comments>
		<pubDate>Mon, 28 Sep 2009 13:57:05 +0000</pubDate>
		<dc:creator>Praveen Ray</dc:creator>
				<category><![CDATA[Computer Languages]]></category>
		<category><![CDATA[Web Applications / User Interface Design]]></category>
		<category><![CDATA[extjs]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://blogs.yellowfish.biz/?p=224</guid>
		<description><![CDATA[An easy way to add clickable links to Extjs grid Cells.]]></description>
			<content:encoded><![CDATA[<p>Although the extjs <a href="http://www.extjs.com/deploy/dev/examples/samples.html#sample-2">grid</a> is an awesome component, IMO, it suffers from one major drawback &#8211; it&#8217;s inability to place active components within data cells. At least it&#8217;s not straightforward. Here&#8217;s a simple solution to place clickable links within cells. The trick is to place <span>s which look like links and then intercept rowclick and determine which of many links was clicked on.</p>
<p>Here&#8217;s an example of a custom Grid Component:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">function</span> MyComponent<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
   MyComponent.<span style="color: #660066;">superclass</span>.<span style="color: #660066;">constructor</span>.<span style="color: #660066;">call</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
Ext.<span style="color: #660066;">extend</span><span style="color: #009900;">&#40;</span>MyComponent<span style="color: #339933;">,</span> Ext.<span style="color: #660066;">grid</span>.<span style="color: #660066;">GridPanel</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
MyComponent.<span style="color: #660066;">prototype</span>.<span style="color: #660066;">initComponent</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  <span style="color: #003366; font-weight: bold;">var</span> action_tmpl <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> Ext.<span style="color: #660066;">XTemplate</span><span style="color: #009900;">&#40;</span>
     <span style="color: #3366CC;">&quot;&lt;span class='link' id='edit-{id}'&gt;Edit&lt;/span&gt;&quot;</span><span style="color: #339933;">,</span>
     <span style="color: #3366CC;">&quot;&lt;span class='link' id='delete-{id}'&gt;Delete&lt;/span&gt;&quot;</span>
   <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
   action_tmpl.<span style="color: #660066;">compile</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
   <span style="color: #003366; font-weight: bold;">var</span> content <span style="color: #339933;">=</span> <span style="color: #009900;">&#123;</span>
     <span style="color: #006600; font-style: italic;">// grid related config</span>
     columns<span style="color: #339933;">:</span> <span style="color: #009900;">&#91;</span>
        <span style="color: #009900;">&#123;</span>header<span style="color: #339933;">:</span> <span style="color: #3366CC;">'First Name'</span><span style="color: #339933;">,</span> dataIndex<span style="color: #339933;">:</span><span style="color: #3366CC;">'fname'</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
        <span style="color: #009900;">&#123;</span>header<span style="color: #339933;">:</span> <span style="color: #3366CC;">'Action'</span><span style="color: #339933;">,</span> dataIndex<span style="color: #339933;">:</span><span style="color: #3366CC;">'id'</span><span style="color: #339933;">,</span> 
          renderer<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>c<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> 
              <span style="color: #000066; font-weight: bold;">return</span> action_tmpl.<span style="color: #660066;">applyTemplate</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>id<span style="color: #339933;">:</span> id<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
          <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#125;</span>
     <span style="color: #009900;">&#93;</span>
   <span style="color: #009900;">&#125;</span>
   MyComponent.<span style="color: #660066;">superclass</span>.<span style="color: #660066;">initComponent</span>.<span style="color: #660066;">call</span><span style="color: #009900;">&#40;</span>Ext.<span style="color: #660066;">apply</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #339933;">,</span>content<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
MyComponent.<span style="color: #660066;">prototype</span>.<span style="color: #660066;">afterRender</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  MyComponent.<span style="color: #660066;">superclass</span>.<span style="color: #660066;">afterRender</span>.<span style="color: #660066;">call</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">on</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'rowclick'</span><span style="color: #339933;">,</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">row_click</span><span style="color: #339933;">,</span> <span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
MyComponent.<span style="color: #660066;">prototype</span>.<span style="color: #660066;">row_click</span><span style="color: #339933;">=</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>grid<span style="color: #339933;">,</span> ri<span style="color: #339933;">,</span> evt<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
   <span style="color: #003366; font-weight: bold;">var</span> rec <span style="color: #339933;">=</span> grid.<span style="color: #660066;">getStore</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">getAt</span><span style="color: #009900;">&#40;</span>ri<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
   <span style="color: #006600; font-style: italic;">// See Below for within_el method</span>
   <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>evt.<span style="color: #660066;">within_el</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'edit-'</span><span style="color: #339933;">+</span>r.<span style="color: #660066;">id</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
       <span style="color: #000066;">alert</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'Edit clicked'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
   <span style="color: #009900;">&#125;</span> <span style="color: #000066; font-weight: bold;">else</span> <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>evt.<span style="color: #660066;">within_el</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'delete-'</span><span style="color: #339933;">+</span>r.<span style="color: #660066;">id</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #000066;">alert</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'Delete clicked'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
   <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p> The within_el method on Ext.EventObject object looks like this:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">Ext.<span style="color: #660066;">apply</span><span style="color: #009900;">&#40;</span>Ext.<span style="color: #660066;">EventObject</span><span style="color: #339933;">,</span> <span style="color: #009900;">&#123;</span>
    within_el<span style="color: #339933;">:</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>el<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        el <span style="color: #339933;">=</span> Ext.<span style="color: #660066;">get</span><span style="color: #009900;">&#40;</span>el<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span>el<span style="color: #009900;">&#41;</span>
            <span style="color: #000066; font-weight: bold;">return</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #339933;">;</span>
        <span style="color: #003366; font-weight: bold;">var</span> evt_xy <span style="color: #339933;">=</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">getXY</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #003366; font-weight: bold;">var</span> evt_x <span style="color: #339933;">=</span> evt_xy<span style="color: #009900;">&#91;</span><span style="color: #CC0000;">0</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
        <span style="color: #003366; font-weight: bold;">var</span> evt_y <span style="color: #339933;">=</span> evt_xy<span style="color: #009900;">&#91;</span><span style="color: #CC0000;">1</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
        <span style="color: #000066; font-weight: bold;">return</span> <span style="color: #009900;">&#40;</span>evt_x <span style="color: #339933;">&gt;</span> el.<span style="color: #660066;">getLeft</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;&amp;</span> evt_x <span style="color: #339933;">&lt;</span> el.<span style="color: #660066;">getRight</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;&amp;</span> evt_y <span style="color: #339933;">&gt;</span> el.<span style="color: #660066;">getTop</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;&amp;</span> evt_y <span style="color: #339933;">&lt;</span> el.<span style="color: #660066;">getBottom</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://blogs.yellowfish.biz/2009/extjs-links-in-grid-cells/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Nginx and File Upload Progress</title>
		<link>http://blogs.yellowfish.biz/2009/nginx-and-file-upload-progress/</link>
		<comments>http://blogs.yellowfish.biz/2009/nginx-and-file-upload-progress/#comments</comments>
		<pubDate>Wed, 17 Jun 2009 13:19:05 +0000</pubDate>
		<dc:creator>Praveen Ray</dc:creator>
				<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Web Applications / User Interface Design]]></category>
		<category><![CDATA[Web Frameworks]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[extjs]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[nginx]]></category>
		<category><![CDATA[web 2.0]]></category>
		<category><![CDATA[website]]></category>

		<guid isPermaLink="false">http://blogs.yellowfish.biz/?p=93</guid>
		<description><![CDATA[Show a Progress Meter while uploading files when using nginx as front end proxy]]></description>
			<content:encoded><![CDATA[<p>Keeping in philosophy of KISS, <a href="http://nginx.net" target="_blank">nginx</a> is an awesome, simple web server. It does few things and does it extremely well.<br />
It doesn&#8217;t do CGI but does proxy&#8217;ing and that makes it extremely useful as a front end web server. I recently had to implement an <a href="http://www.extjs.com" target="_blank"> extjs</a> based progress bar for large file uploads with nginx acting as a front end to a Rack/mongrel based application. Here are the steps for <a href="http://www.ubuntu.com" target="_blank">ubuntu</a>.</p>
<p>Do not install nginx from the repo. Uninstall if it&#8217;s already installed.</p>

<div class="wp_syntax"><div class="code"><pre class="perl" style="font-family:monospace;">apt<span style="color: #339933;">-</span>get remove nginx</pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="perl" style="font-family:monospace;"><span style="color: #000066;">mkdir</span> <span style="color: #339933;">-</span>p <span style="color: #339933;">/</span>opt<span style="color: #339933;">/</span>downloads
cd <span style="color: #339933;">/</span>opt<span style="color: #339933;">/</span>downloads</pre></div></div>

<p>Download nginx sources from nginx.net and unpack (I&#8217;m working with nginx-0.6.36):</p>

<div class="wp_syntax"><div class="code"><pre class="perl" style="font-family:monospace;">tar zxf nginx<span style="color: #339933;">-</span>0<span style="color: #339933;">.</span>6<span style="color: #339933;">.</span>36<span style="color: #339933;">.</span>tar<span style="color: #339933;">.</span>gz</pre></div></div>

<p>Download an untar upload progress module from nginx <a href="http://wiki.nginx.org/NginxHttpUploadProgressModule" target="_blank">wiki<br />
</a></p>

<div class="wp_syntax"><div class="code"><pre class="perl" style="font-family:monospace;">tar zxf Nginx_uploadprogress_module<span style="color: #339933;">-</span>0<span style="color: #339933;">.</span>5<span style="color: #339933;">.</span>tar<span style="color: #339933;">.</span>gz
cd nginx<span style="color: #339933;">-</span>0<span style="color: #339933;">.</span>6<span style="color: #339933;">.</span>36
<span style="color: #339933;">./</span>configure <span style="color: #339933;">--</span>prefix<span style="color: #339933;">=/</span>opt<span style="color: #339933;">/</span>nginx <span style="color: #339933;">--</span>add<span style="color: #339933;">-</span>module<span style="color: #339933;">=/</span>opt<span style="color: #339933;">/</span>downloads<span style="color: #339933;">/</span>nginx_uploadprogress_module
make install</pre></div></div>

<p>This&#8217;ll install nginx in /opt/nginx</p>
<h2>Configuration</h2>
<p>open up /opt/nginx/conf/nginx.conf and add following lines:</p>

<div class="wp_syntax"><div class="code"><pre class="perl" style="font-family:monospace;">http <span style="color: #009900;">&#123;</span>
     client_max_body_size 30M<span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;"># adjust as per your need</span>
     upload_progress proxied 1m<span style="color: #339933;">;</span>
&nbsp;
     server <span style="color: #009900;">&#123;</span>
         server_name <span style="color: #b1b100;">my</span><span style="color: #339933;">.</span>server<span style="color: #339933;">.</span>com<span style="color: #339933;">;</span>
         <span style="color: #000066;">listen</span> <span style="color: #cc66cc;">80</span><span style="color: #339933;">;</span>
         root <span style="color: #339933;">/</span>var<span style="color: #339933;">/</span>www<span style="color: #339933;">/</span>nginx<span style="color: #339933;">-</span>default<span style="color: #339933;">/</span>my<span style="color: #339933;">-</span>static<span style="color: #339933;">-</span>files<span style="color: #339933;">;</span>
&nbsp;
         location <span style="color: #339933;">/</span>ajax <span style="color: #009900;">&#123;</span>
             proxy_pass http<span style="color: #339933;">://</span>localhost<span style="color: #339933;">:</span><span style="color: #cc66cc;">2300</span><span style="color: #339933;">;</span>
             proxy_redirect default<span style="color: #339933;">;</span>
             track_uploads proxied 30s<span style="color: #339933;">;</span>
         <span style="color: #009900;">&#125;</span>
         location <span style="color: #339933;">^~</span> <span style="color: #339933;">/</span>report_file_uploads <span style="color: #009900;">&#123;</span>
              report_uploads proxied<span style="color: #339933;">;</span>
         <span style="color: #009900;">&#125;</span>
     <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>This assumes  &#8216;/ajax&#8217; is the backend application proxy.</p>
<p>In Javascript, to get progress bar going, send following AJAX message in a loop, after the form with file upload field has been submitted.</p>
<p>Lots of details are omitted since these are dependent upon your javascript library of choice (which, btw, for us is <a href="http://www.extjs.com" target="_blank">extjs</a>).</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">var</span> upload_id <span style="color: #339933;">=</span> <span style="color: #3366CC;">'MyUniqueID'</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">// upload_id must be unique for each upload session</span>
<span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">send_ajax_message</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>
       url<span style="color: #339933;">:</span> <span style="color: #3366CC;">'/report_file_uploads'</span><span style="color: #339933;">,</span>
       headers<span style="color: #339933;">:</span> <span style="color: #009900;">&#123;</span><span style="color: #3366CC;">'X-Progress-ID'</span> <span style="color: #339933;">:</span> upload_id<span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
       method<span style="color: #339933;">:</span><span style="color: #3366CC;">'GET'</span><span style="color: #339933;">,</span>
       success<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>r<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
              r <span style="color: #339933;">=</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">parse_ajax_response</span><span style="color: #009900;">&#40;</span>r<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
             <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>r.<span style="color: #660066;">state</span> <span style="color: #339933;">==</span> <span style="color: #3366CC;">'uploading'</span> <span style="color: #339933;">||</span> r.<span style="color: #660066;">state</span> <span style="color: #339933;">==</span> <span style="color: #3366CC;">'starting'</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                <span style="color: #003366; font-weight: bold;">var</span> percent <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span>Number<span style="color: #009900;">&#40;</span>r.<span style="color: #660066;">received</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">/</span>Number<span style="color: #009900;">&#40;</span>r.<span style="color: #660066;">size</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>percent <span style="color: #339933;">&amp;</span>gt<span style="color: #339933;">;</span> <span style="color: #CC0000;">1.0</span><span style="color: #009900;">&#41;</span>
                    percent <span style="color: #339933;">=</span> <span style="color: #CC0000;">1.0</span><span style="color: #339933;">;</span>
                 <span style="color: #006600; font-style: italic;">//show percent as you wish on your progress meter</span>
                 <span style="color: #006600; font-style: italic;">// sleep for few seconds and send this ajax message again</span>
             <span style="color: #009900;">&#125;</span> <span style="color: #000066; font-weight: bold;">else</span> <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>r.<span style="color: #660066;">state</span> <span style="color: #339933;">==</span> <span style="color: #3366CC;">'done'</span> <span style="color: #339933;">||</span> r.<span style="color: #660066;">state</span> <span style="color: #339933;">==</span> <span style="color: #3366CC;">'error'</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                <span style="color: #006600; font-style: italic;">// kill your loop timer</span>
                <span style="color: #006600; font-style: italic;">// finish your progress meter</span>
             <span style="color: #009900;">&#125;</span>
        <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Let me know if you&#8217;d like javascript fragment for extjs and I&#8217;ll post it but it&#8217;s relatively straightforward.</p>
<p>At <a href="http://www.yellowfish.biz" target="_blank">Yellowfish</a>, we specialize in web2.0 Ajax web application development using open source tools and modern software trends.</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.yellowfish.biz/2009/nginx-and-file-upload-progress/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>The all important user interface</title>
		<link>http://blogs.yellowfish.biz/2009/the-all-important-user-interface/</link>
		<comments>http://blogs.yellowfish.biz/2009/the-all-important-user-interface/#comments</comments>
		<pubDate>Fri, 12 Jun 2009 16:18:19 +0000</pubDate>
		<dc:creator>Praveen Ray</dc:creator>
				<category><![CDATA[Software Design]]></category>
		<category><![CDATA[Website Design]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[extjs]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[ui]]></category>
		<category><![CDATA[user-interface]]></category>
		<category><![CDATA[web-design]]></category>

		<guid isPermaLink="false">http://blogs.yellowfish.biz/lb/?p=30</guid>
		<description><![CDATA[Most of core software developers tend to brush off &#8216;user interface&#8217; thingies. &#8216;HTML developers&#8217; are looked down upon by people working on the cool backend technologies. The mere fact that UI designers get paid far less than their backend counterparts is a proof of my assertion.

Goes on to prove the geeks have it all wrong [...]]]></description>
			<content:encoded><![CDATA[<p>Most of core software developers tend to brush off &#8216;user interface&#8217; thingies. &#8216;HTML developers&#8217; are looked down upon by people working on the cool backend technologies. The mere fact that UI designers get paid far less than their backend counterparts is a proof of my assertion.
</p>
<p>Goes on to prove the geeks have it all wrong when it comes to selling!</p>
<p>Good, slick user interface is quite hard to achieve. It requires vision, imagination, training in human psychology AND a quite a bit of technical wizardy. Try navigating all corners of CSS and then make yourself cross browser. You&#8217;ll know what I&#8217;m talking about. Apple is where it is today simply because of it&#8217;s fantastic user interface. There&#8217;s nothing one could not do with good old PCs before Macs made a comeback. Yet people rushed to pay extra dollars to get the coolest computer on earth. Ease of use ? Stylish? Marketing? Status Symbol? Be different syndrome? You can call it what you like but if it were not for the beatiful interface, Apple wouldn&#8217;t have survived it&#8217;s comeback for this long.</P><br />
Contrary to popular wisdom, Looks ARE everything. People are shallow. The managers controlling the money purse are technologically shallow and ill-informed. Show &#8216;em your multi-threaded, fault-tolerant, highly scalable database which has an inferior look and feel and you&#8217;re sure to lose that sale. Absolutely. It&#8217;s guaranteed.<br />
Pay attention to usability and some amount of eye-candy right from the beginning. Even your prototypes have to look slick, even with reduced functionality, if you&#8217;ve any hopes of raising capital or generating interest. Don&#8217;t discount the shallowness of the masses.</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.yellowfish.biz/2009/the-all-important-user-interface/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>ExtJS : Our favorite Javascript Ajax Library</title>
		<link>http://blogs.yellowfish.biz/2009/extjs-our-favorite-javascript-ajax-library/</link>
		<comments>http://blogs.yellowfish.biz/2009/extjs-our-favorite-javascript-ajax-library/#comments</comments>
		<pubDate>Fri, 12 Jun 2009 15:17:36 +0000</pubDate>
		<dc:creator>Praveen Ray</dc:creator>
				<category><![CDATA[Web Frameworks]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[extjs]]></category>
		<category><![CDATA[framework]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[library]]></category>
		<category><![CDATA[license]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://blogs.yellowfish.biz/?p=42</guid>
		<description><![CDATA[There are number of ajax javascript libraries and frameworkds out there and it can be excruciating to try and find the best fit your projects and organization. A good library should encapsulate most often used patterns and provide clear and easy to use abstractions. No library, however mature, can be complete, since it&#8217;s always possible [...]]]></description>
			<content:encoded><![CDATA[<p>There are number of ajax javascript libraries and frameworkds out there and it can be excruciating to try and find the best fit your projects and organization. A good library should encapsulate most often used patterns and provide clear and easy to use abstractions. No library, however mature, can be complete, since it&#8217;s always possible to find that one most important piece of missing functionality that you need. So, extensionability is a major requirement.</p>
<p>Javascript is an awesome language. It&#8217;s super flexible. It empowers the developer with immense flexibility. You can use the power to advance world peace or choose to shoot yourself. It&#8217;s totally upto you. As spiderman said &#8211; with power comes responsibility. Since there are no private namespaces in Javascript, it&#8217;s ultra important that the library you choose NEVER dirties your namespace and lives completely inside it&#8217;s own namespace. One of the most popular javascript library &#8211; prototype.js &#8211; violates this principle completely and IMHO, should be used with care.</p>
<p>Javascript started in Browsers and even today it&#8217;s most often found in the browsers. Browsers are the modern UI paradigm. The javascript library must not be limited to cookie-cutter DOM manipulation APIs. That was cool in the 90s. The Libraries now must provide a rich set of UI Widgets. You don&#8217;t want to be using two Javascript libraries &#8211; one for Ajax and other for UI widgets.</p>
<p>Documentation. If the developer has to resort to &#8216;grep&#8217; the source code to find essential pieces of functionality, the library becomes a time hog instead of rapid development platform!</p>
<p>We looked at quite a few js libraries :</p>
<p>    * JQuery<br />
    * Qooxdoo<br />
    * Dojo<br />
    * Prototype.js<br />
    * mootools<br />
    * extjs</p>
<p>and settled for extjs as our framework of choice.</p>
<p>Here are our reasons for picking a commercial open source library like extjs.<br />
The overall design of extjs is exemplary. One can learn a lot from it&#8217;s unified architecture &#8211; no matter which language one is programming in.</p>
<p>It lives within it&#8217;s own namespace. Prototype.js was out at this point.</p>
<p>The UI widget set is extremely rich. Dojo, qooxdoo and mootools &#8211; although promising, were nowhere close to extjs in widgets collection. Although jquery , with it&#8217;s collection of opensource plugins, has a rich collection, it suffers from one major disadvantage. The plugins are from multiple vendors and there is no consistent Object model to dictate their design. Extjs requires you to start with one of their base classes &#8211; ensuring a consitent model. Consistency is extremely important for the library to be reusable.</p>
<p>Not to mention, extjs documentation seems to be very comprehensive and well maintained. In a library as comprehensive as extjs, one should always be prepared to look into the source code to fund missing bits but all essential pieces are very well documented.</p>
<p>Many people seem to object to commercial licencing of extjs &#8211; however, we believe, the licencing is quite fair and inexpensive. A single developer licence costs less than $300 and one can deploy on unlimited domains. You can develop your application for free and purchase a licence when you go live. For most businesses this shouldn&#8217;t be an issue at all.<br />
On the other hand, if your business can&#8217;t come up with $300.00, you&#8217;ve bigger issues and shouldn&#8217;t be worried about javascript libraries !!</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.yellowfish.biz/2009/extjs-our-favorite-javascript-ajax-library/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
