<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress.com" -->
<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/"
	>

<channel>
	<title>extjs &amp;laquo; WordPress.com Tag Feed</title>
	<link>http://en.wordpress.com/tag/extjs/</link>
	<description>Feed of posts on WordPress.com tagged "extjs"</description>
	<pubDate>Mon, 30 Nov 2009 20:12:47 +0000</pubDate>

	<generator>http://en.wordpress.com/tags/</generator>
	<language>en</language>

<item>
<title><![CDATA[Ext.iterate  Array vs. Object Gotcha! ]]></title>
<link>http://blog.flexuous.com/2009/11/27/ext-iterate-array-vs-object-gotcha/</link>
<pubDate>Fri, 27 Nov 2009 05:45:56 +0000</pubDate>
<dc:creator>justinohms</dc:creator>
<guid>http://blog.flexuous.com/2009/11/27/ext-iterate-array-vs-object-gotcha/</guid>
<description><![CDATA[When calling Ext.iterate with an object the parameters passed back to the iterated function are: (St]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>When calling Ext.iterate with an object the parameters passed back to the iterated function are:</p>
<div>
<pre>(String key, Object value)</pre>
</div>
<p>However when calling Ext.iterate with an array the parameters are:</p>
<div>
<pre>(Object item, Number index, Array allItems)</pre>
</div>
<p>The gotcha here is that in the Ext 3.0 docs only the object call back is shown.  Because of this you might think that the array call returns the index then the actual item bu as you can see that is not the case.</p>
<p>There is a thread on the Ext forum <a href="http://www.extjs.com/forum/showthread.php?t=73645" target="_blank">here</a> about maybe making this consistent in the next major release.</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[[extjs]Getting Started]]></title>
<link>http://goenpedia.wordpress.com/2009/11/26/extjsgetting-started-2/</link>
<pubDate>Thu, 26 Nov 2009 07:30:23 +0000</pubDate>
<dc:creator>goendala</dc:creator>
<guid>http://goenpedia.wordpress.com/2009/11/26/extjsgetting-started-2/</guid>
<description><![CDATA[di postingan gua kali ini, target gua adalah bikin satu workspace (gua pake IDE eclipse), masukin ex]]></description>
<content:encoded><![CDATA[di postingan gua kali ini, target gua adalah bikin satu workspace (gua pake IDE eclipse), masukin ex]]></content:encoded>
</item>
<item>
<title><![CDATA[OpenquickIT: Extjs dashboard, tabs and Catalyst]]></title>
<link>http://poisonbit.wordpress.com/2009/11/24/openquickit-extjs-dashboard-tabs-and-catalyst/</link>
<pubDate>Mon, 23 Nov 2009 23:26:29 +0000</pubDate>
<dc:creator>poisonbit</dc:creator>
<guid>http://poisonbit.wordpress.com/2009/11/24/openquickit-extjs-dashboard-tabs-and-catalyst/</guid>
<description><![CDATA[Here I show a video, of the state of the draft work in the OpenquickIT github repository. Each tab i]]></description>
<content:encoded><![CDATA[Here I show a video, of the state of the draft work in the OpenquickIT github repository. Each tab i]]></content:encoded>
</item>
<item>
<title><![CDATA[Learning ExtJS]]></title>
<link>http://zamshed.wordpress.com/2009/11/23/learning-extjs/</link>
<pubDate>Mon, 23 Nov 2009 11:03:54 +0000</pubDate>
<dc:creator>Zamshed Farhan</dc:creator>
<guid>http://zamshed.wordpress.com/2009/11/23/learning-extjs/</guid>
<description><![CDATA[I am currently trying to learn ExtJS, a great javascript library I have seen ever. BUT,  it seems to]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>I am currently trying to learn <a href="http://www.extjs.com/" target="_blank">ExtJS</a>, a great javascript library I have seen ever. BUT,  it seems to very hard to me as a newbie.  A very simple tutorial written by <strong>Anis uddin Ahmad </strong>of right brain titled of <a href="http://www.ajaxray.com/blog/2009/04/05/extjs-quick-start-guide-for-jquery-developers-javascript-howto/" target="_blank">Extjs quick start guide for jQuery Developers</a> is very helpful. If anyone have more site like this for newbie, may share with me on this blog.</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[[extjs]Introduction]]></title>
<link>http://goenpedia.wordpress.com/2009/11/21/extjsgetting-started/</link>
<pubDate>Sat, 21 Nov 2009 14:28:27 +0000</pubDate>
<dc:creator>goendala</dc:creator>
<guid>http://goenpedia.wordpress.com/2009/11/21/extjsgetting-started/</guid>
<description><![CDATA[&#8220;Tak Kenal maka Tak sayang&#8221; &#8230;. sebelum gua jadi &#8220;penyanyang&#8221; extjs. gu]]></description>
<content:encoded><![CDATA[&#8220;Tak Kenal maka Tak sayang&#8221; &#8230;. sebelum gua jadi &#8220;penyanyang&#8221; extjs. gu]]></content:encoded>
</item>
<item>
<title><![CDATA[[extjs]Starting Point]]></title>
<link>http://goenpedia.wordpress.com/2009/11/21/extjsstarting-point/</link>
<pubDate>Sat, 21 Nov 2009 14:23:59 +0000</pubDate>
<dc:creator>goendala</dc:creator>
<guid>http://goenpedia.wordpress.com/2009/11/21/extjsstarting-point/</guid>
<description><![CDATA[Guys, Gua lagi pengen belajar tentang javascript Library yang namanya &#8220;extjs&#8221;.  dengan p]]></description>
<content:encoded><![CDATA[Guys, Gua lagi pengen belajar tentang javascript Library yang namanya &#8220;extjs&#8221;.  dengan p]]></content:encoded>
</item>
<item>
<title><![CDATA[Beginings with Ext 3.0 JS library (combobox)]]></title>
<link>http://blog.flexuous.com/2009/11/18/beginings-with-ext-3-0-js-library-combobox/</link>
<pubDate>Wed, 18 Nov 2009 19:50:16 +0000</pubDate>
<dc:creator>justinohms</dc:creator>
<guid>http://blog.flexuous.com/2009/11/18/beginings-with-ext-3-0-js-library-combobox/</guid>
<description><![CDATA[I started working on a project a few months ago that leveraged the Ext JavaScript  library for just ]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>I started working on a project a few months ago that leveraged the Ext JavaScript  library for just a handful of features.  After some requests for some improvements in one section I decided to try to leverage a little more of the Ext library to improve it.  I decided to start just by redoing a form to use remoting.   Now I&#8217;ve done this kind of thing before  in all of the  the Adobe Action-script platforms ( Flex, Flash and Air)  so I am rather comfortable with the basic concepts.    I am also very comfortable with JavaScript having worked with it for over 10 years and using DHTML and other tricks (img src updates, etc.)  to do Ajax type magic before Ajax was even in the lexicon. I will say that some of the conventions used by JS developers drive me nuts&#8230; but that&#8217;s all formatting.   One really completely new area for me was JSON.  I&#8217;ve always wanted to try it so I figured this was the perfect opportunity.  So I started with a simple task on this one form.   Populate a single Combo Box remotely from a JSON datasource.  Now when I learn to program a new language (or library in this case) I need two things.   The docs and working examples.    On the documentation side of things Ext has a very good API documentation at <a href="http://www.extjs.com/deploy/dev/docs/" target="_blank">http://www.extjs.com/deploy/dev/docs/</a> The one area I found lacking was in the way of simple examples.    One thing I always liked from Adobe documentation was the examples that were included the docs.   Always very simple and always just focused around the one object you were looking at.    Ext has provided some really nice sample applications at <a href="http://www.extjs.com/deploy/dev/examples/samples.html" target="_blank">http://www.extjs.com/deploy/dev/examples/samples.html</a> however it can be a bit hit and miss to locate the combination of examples that have the features you are looking for.   In particular I could not locate a single example that was just as simple as &#8230;. here is how you load JSON data into a combo-box.   I finally found a good one at  <a href="http://technopaper.blogspot.com/2009/11/dynamic-loading-of-combobox-using-extjs.html#comments" target="_blank">http://technopaper.blogspot.com/2009/11/dynamic-loading-of-combobox-using-extjs.html#comments</a> I hope to leave some additional posts as I find bits and pieces here and there.</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Жизнь продолжается]]></title>
<link>http://disole.wordpress.com/2009/11/13/%d0%b6%d0%b8%d0%b7%d0%bd%d1%8c-%d0%bf%d1%80%d0%be%d0%b4%d0%be%d0%bb%d0%b6%d0%b0%d0%b5%d1%82%d1%81%d1%8f/</link>
<pubDate>Fri, 13 Nov 2009 11:29:49 +0000</pubDate>
<dc:creator>ignar</dc:creator>
<guid>http://disole.wordpress.com/2009/11/13/%d0%b6%d0%b8%d0%b7%d0%bd%d1%8c-%d0%bf%d1%80%d0%be%d0%b4%d0%be%d0%bb%d0%b6%d0%b0%d0%b5%d1%82%d1%81%d1%8f/</guid>
<description><![CDATA[Спешу сообщить, что мой адрес поменялся. Если Вы нашли какую то мою запись интересной, проверьте мож]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p><strong>Спешу сообщить, что мой адрес </strong><a href="http://ignar.name"><strong>поменялся</strong></a><strong>.</strong></p>
<p>Если Вы нашли какую то мою запись интересной, проверьте может к ней есть продолжение или исправления.</p>
<p>Живой блог лучше чем мертвый.</p>
<p>Новая rss волна &#8211; <a href="http://feeds.feedburner.com/ignar" target="_blank">ignar&#8217;s log</a></p>
<p>Мой твиттер остался неизменным &#8211; <a href="http://twitter.com/ignart" target="_blank">ignart</a></p>
<p>Мои <a href="http://ignar.name/ignar/" target="_self">контакты</a></p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[IE7 overflow issue, while working with ExtJS]]></title>
<link>http://vladcd.wordpress.com/2009/11/10/ie7-overflow-issue-while-working-with-extjs/</link>
<pubDate>Mon, 09 Nov 2009 22:48:23 +0000</pubDate>
<dc:creator>vladcd</dc:creator>
<guid>http://vladcd.wordpress.com/2009/11/10/ie7-overflow-issue-while-working-with-extjs/</guid>
<description><![CDATA[I&#8217;ll start by saying that I found this bug while working with ExtJS. It&#8217;s worth noting b]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>I&#8217;ll start by saying that I found this bug while working with ExtJS. It&#8217;s worth noting because it ws very frustrating to deal with, and also, I could not find an actual bug explanation.</p>
<p>The simplified test case code for this would be:</p>
<pre>
Ext.onReady(function() {
var win = new Ext.Window( {
width : 300,
height : 300,
layout : 'fit',
items : [ {
xtype : 'form',
layout : 'anchor',
items : [ {
xtype : 'tabpanel',
anchor : '100% 100%',
autoScroll : true,
items : [ {
title : 'Tab 1',
id : 'tab1',
html : 'Really complex content goes here'
} ],
activeTab : 0
} ]
} ]
});
win.show();
});</pre>
<p>This shows a window, containinga tab panel, with only one tab and some text in it. In order to observe the strange behavior, after the page displays, try setting the height of the tab to 500px.</p>
<pre>Ext.getCmp('tab1').setHeight(500);</pre>
<p>If you run this from Firebug&#8217;s console, or from IE8&#8217;s developer tools script console, you will notice that scroll bars will appear in an instant. However, if you set IE8 to function on IE7 Browser Mode and IE7 Document Standards, and then run the same command, the overflow will appear not to function. In fact, it seems that IE7, instead of adding the scrollbars on the inside of the overflowed container (as it usually does), it adds them on the outside of the contained div. This is way they are not visible. However, even if they were visible, they wouldn&#8217;t work.</p>
<p>The generated HTML structure which causes this problem can be simplified like this:</p>
<pre>&#60;div style="overflow: auto; width: 282px; height: 238px;"&#62;
&#60;div style="width: 282px; height: 500px; overflow:hidden; position:relative;"&#62;
Really complex content goes here
&#60;/div&#62;
&#60;/div&#62;
</pre>
<p>So, even if you will notice the scrollbars are visible, they will not function in IE7. After trying to remove different stuff to see what&#8217;s broken, I noticed it&#8217;s got something to do with the position:relative attribute. Even if this seems like a sufficiently easy fix, it didn&#8217;t work on my complex layout.</p>
<p>So, without finding an actual solution, I settled for this workaround:</p>
<pre>
Ext.onReady(function() {
var win = new Ext.Window( {
width : 300,
height : 300,
layout : 'fit',
items : [ {
xtype : 'form',
layout : 'anchor',
items : [ {
xtype : 'tabpanel',
anchor : '100% 100%',
items : [ {
title : 'Tab 1',
autoScroll : true,
items : [{
xtype : 'panel',
html : 'Really complex content goes here',
height : 500
}]
} ],
activeTab : 0
} ]
} ]
});
win.show();
});
</pre>
<p>So instead of trying to make the tab panel scroll its body, I added an intermediary object which does only that: overflow : auto; Its content is correctly scrolled in Firefox, IE8 and IE7.</p>
<p>So far, this is the best I could come up with, and I&#8217;m happy that at least it works.</p>
<p>Later edit:<br />
Seems like the solution was simpler than that: all I had to do was to specify position:relative for the element with overflow:auto. A very good explanation can be found <a href="http://www.rowanw.com/bugs/overflow_relative.htm" target="_blank">here</a></p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Blog Stats past month]]></title>
<link>http://nicolasdemarty.wordpress.com/2009/11/09/blog-stats-past-month/</link>
<pubDate>Mon, 09 Nov 2009 18:11:12 +0000</pubDate>
<dc:creator>nicolasdemarty</dc:creator>
<guid>http://nicolasdemarty.wordpress.com/2009/11/09/blog-stats-past-month/</guid>
<description><![CDATA[Top 3 Terms people used to find this blog: 1. Pentaho &#8211; extjs 2. PRD &#8211; BI Server publish]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Top 3 Terms people used to find this blog:</p>
<p style="padding-left:30px;">1. Pentaho &#8211; extjs</p>
<p style="padding-left:30px;">2. PRD &#8211; BI Server publish password</p>
<p style="padding-left:30px;">3. Pentaho cdf</p>
<p style="padding-left:30px;">
<p style="padding-left:30px;">
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[New book: "Ext JS 3.0 Cookbook" announced by Packt publishing]]></title>
<link>http://mankzblog.wordpress.com/2009/11/02/new-book-ext-js-3-0-cookbook-announced-by-packt-publishing/</link>
<pubDate>Mon, 02 Nov 2009 19:39:18 +0000</pubDate>
<dc:creator>Mats Bryntse</dc:creator>
<guid>http://mankzblog.wordpress.com/2009/11/02/new-book-ext-js-3-0-cookbook-announced-by-packt-publishing/</guid>
<description><![CDATA[Packt publishing recently announced the new Ext JS 3.0 Cookbook. They provided me with a copy and as]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p><a href="http://www.packtpub.com/">Packt publishing</a> recently announced the new Ext JS 3.0 Cookbook. They provided me with a copy and asked me to do a review which I happily agreed to. Check back in a week or two to read my full review. Here&#8217;s some of the good stuff covered in the book:</p>
<blockquote><ul>
<li>Master the Ext JS widgets and learn to create custom components to suit your needs</li>
<li> Build striking native and custom layouts, forms, grids, listviews, treeviews, charts, tab panels, menus, toolbars and much more for your real-world user interfaces</li>
<li>Packed with easy-to-follow examples to exercise all of the features of the Ext JS library</li>
<li>Part of Packt&#8217;s Cookbook series: Each recipe is a carefully organized sequence of instructions to complete the task as efficiently as possible</li>
</ul>
</blockquote>
<p>So far there has only been a few books released about ExtJS so this book is definitely good news! It looks like a very interesting read judging from the TOC, click the image to learn more!</p>
<p><a href="http://www.packtpub.com/ext-js-3-0-cookbook?utm_source=mankzblog.wordpress.com&#38;utm_medium=link&#38;utm_content=blog&#38;utm_campaign=mdb_001285"><img src="http://mankzblog.wordpress.com/files/2009/11/1847198708.jpg?w=121" alt="Ext JS 3.0 Cookbook" title="Ext JS 3.0 Cookbook" width="121" height="150" class="aligncenter size-thumbnail wp-image-179" /></a></p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[CFINNC Update]]></title>
<link>http://cfmeta.net/2009/10/28/cfinnc-update/</link>
<pubDate>Wed, 28 Oct 2009 21:44:14 +0000</pubDate>
<dc:creator>bchesley</dc:creator>
<guid>http://cfmeta.net/2009/10/28/cfinnc-update/</guid>
<description><![CDATA[The conference in Raleigh was really excellent with attendance of around 250. Sessions that I got th]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>The conference in Raleigh was really excellent with attendance of around 250.</p>
<p>Sessions that I got the most out included two on ORM by Bob Silverberg that got down to code samples of what is great about the ORM approach to database access and management.  TIP &#8211; no need for cfQueryParam with ORM any more &#8211; woot!  See Bob&#8217;s basepersistentobject.riaforge.com for something to get started, and read the Adobe help on this first as it is very good.</p>
<p>Building RIAs using Ext JS 3.0 and ColdFusion was very informative as Paul Cormier has been using the ExtJS and CF together for a while.</p>
<p>Sean Corfield also delivered an impassioned overview of the ColdFusion open source landscape and threw down the gauntlet to CF developers to give back.  I will see what I can do!</p>
<p>Oh, also liked Andy Matthews session on CF and AIR with jQuery.  AIR apps rock.  Check out the AIR Introspector &#8211; like firebug for AIR apps &#8211; air.introspector.console.log to invoke it.</p>
<p>Did two sessions on the CFBuilder IDE including Charlie Arehart&#8217;s Hidden Gems in CFBuilder and Simon Free&#8217;s CFBuilder Basics.  I will definitely be using CFB for the productivity enhancements and tight integration with CF.</p>
<p>Finally, Excel and Coldfusion delivered by Jim Wright compared advanced Excel file creation and manipulation pre CF9 and compared it to what is new with CF9  new features.  See http://www.bennadel.com/projects/poi-utility.htm for information on the POIUtility.cfc by Ben Nadel for more information. POI not good only at a luau!</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[ExtJs. Preconfigured class.]]></title>
<link>http://andrewgolik.wordpress.com/2009/10/28/extjs-preconfigured-class/</link>
<pubDate>Tue, 27 Oct 2009 23:58:36 +0000</pubDate>
<dc:creator>Andrew Golik</dc:creator>
<guid>http://andrewgolik.wordpress.com/2009/10/28/extjs-preconfigured-class/</guid>
<description><![CDATA[&nbsp;I just have read the post http://www.extjs.com/forum/showthread.php?t=26728. &nbsp;I disagree ]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>&#160;I just have read the post<br />
<a href="http://www.extjs.com/forum/showthread.php?t=26728">http://www.extjs.com/forum/showthread.php?t=26728</a>.</p>
<p>&#160;I disagree the concept of “Preconfigured class” considered as suggestion. Probably, in some cases it is OK but they are few of them. When I first time faced the “Preconfigured class” in extjs, I recall the ASP.NET ecosystem controls immediately. Because both &#8220;Preconfigured class&#8221; and ASP.NET control class use inheritance to customize, there are some pitfalls that are intrinsic to them:</p>
<pre><code>
public partial class MyControl : System.Web.UI.UserControl
{
        private void CreateUrlResolver(){
        ...

        private Renderer GetRenderer(){
        ...

        protected void Button1_Click(object sender, EventArgs e)
        {
                //some logic
        }
...
</code></pre>
<ol>
<li> The class is not testable as it is part of UI framework so you cannot unit tests it. You need to employ other techniques as is extra effort.</li>
<li> The class is usually littered with a lot of code. There are  event handling, creation methods, and view methods that are related to rendering. These all violate <a href="http://en.wikipedia.org/wiki/Single_responsibility_principle">SRP</a> and it is nightmare to maintain such classes in system.</li>
</ol>
<p>&#160;The javascript environment is much more flexible but people still use inheritance. I have seen a lot of samples where people extend the Ext.Component in order to add one event handler only, thereby making constrains for them to unit test and utilize it again. For instance, there is a panel with button that is charged with task of saving current state. In case of “Preconfigured class” I would have something like this.</p>
<pre><code>
var StatePanel = Ext.extend(Ext.Panel,  {
        frame:true,
        renderTo:'panel',
        constructor:function(config) {
           config.items = config.items &#124;&#124; [];
           var button = new Ext.Button({text:"Ok", width:50});
           config.items.push(button);
           StatePanel.superclass.constructor.call(config, this);
           button.on("click", this.onClick, this);
        },

        onClick:function() {
                 // save the current state
         }
});
</code></pre>
<p>&#160;Let’s assess the implementation above:</p>
<ol>
<li> Complexity.  It invokes extending mechanism to emulate inheritance &#8211; that means extra manipulation with JavaScript’s prototypes. It is complex and emits the extra objects and closures that support inheritance.</li>
<li> Reusability. What is really annoying is that the code that is charged with saving state is sealed. It cannot be used anywhere else. Sure, you can derive the base panel class and inject it there, thereby making messy at the abstract level. I mean that you shouldn’t share functionality with the base class. If you would use it as store of common methods it just loses its cohesion. You cannot maintain the class that is littered with a lot of aspects of system in future.</li>
<li> Testability. This class is part of UI framework so the unit testing is an issue. You need some scaffolding to run it.</li>
</ol>
<p>&#160;If you dare to test it, you need html holder (it is div element with id) for your panel and then you have to init it in “set up”.</p>
<pre>
<code>
function set_up(){
     _testPanel =   new StatePanel({renderId:”testId”});
}
function testMethod(){
     .....
}
</code>
</pre>
<p>&#160;You always need to keep in mind both ExtJs and UnitTestRunner lifecycles. But the most routine would be clean up code after the test as each test is interlaced with html.</p>
<p>&#160;Let’s assess the same &#8220;StatePanel&#8221;  but all handling is moved to &#8220;StateHandler&#8221; class that acts as controller:</p>
<pre>
<code>
function StateHandler(button) {
            this.init = function(component) {
            this._component = component;
            button.on("click", this.onClick, this);
           }

           this.onClick = function() {
                  // save the current state
            }
}

var button = new Ext.Button({text:"Ok", width:50});
var stateHandler = new StateHandler(button);
new Ext.Panel({frame:true, renderTo:'panel',items:[button],plugins:[stateHandler]});
</code>
</pre>
<p>What we have gained here:</p>
<ol>
<li> Complexity. I have plain object with single responsibility and it’s cool.</li>
<li> Reusability. I can plug it to any component.</li>
<li> I can simply test it without any scaffolding as I have plain object not connected to UI framework.</li>
</ol>
<p>&#160;This implementation recalls the MVC pattern, especially <a href="http://martinfowler.com/eaaDev/PassiveScreen.html.">PassiveView</a>. The idea is to make the view a dumb slave to move all code to the controller. It doesn&#8217;t mean that view is untouchable, it rather means that view should encompass methods that are familial to view. It could be methods that deal with the rendering which probably requires the intimate overrides. The new API of view could be subject to extend it. </p>
<p>&#160;In sample above I used the plugins property to inject controller. </p>
<pre>
    <code>
         var button = new Ext.Button({text:"Ok", width:50});
         var stateHandler = new StateHandler(button);
         new Ext.Panel({frame:true, renderTo:'panel',items:[button],plugins:[stateHandler]});
    </code>
  </pre>
<p>&#160;You can use any kind of injection. The &#8220;plugins&#8221; property as pattern is not requirement. Use any creational patterns not to duplicate the creation of panel as well as gain flexibility in re-using the code and applying conditional algorithms there.</p>
<pre>
<code>
MyApplication.windows.FormBuilder.CreateMySuperPanel = function(){
           //some conditional logic related to creation
           //
           var panel = new Ext.Panel({frame:true, renderTo:'panel',items:[button]);
           var button = new Ext.Button({text:"Ok", width:50});
           var stateHandler = new StateHandler(button);
           stateHandler.init(panel); 

}
</code>
</pre>
<p>&#160;You can approach it in many ways, the main is to keep in mind separation of concerns. The initial concern is to wire all dependencies. I bet it&#8217;s much better to have class named &#8220;builder&#8221; that creates the panel at your will rather than to extend that panel for injection of only creation routine.  </p>
<pre>
  <code>
  var StatePanel = Ext.extend(Ext.Panel,  {
    myConfigConstant:'someConstant',
    frame:true,
    ...
    constructor:function(config) {
           config.items = config.items &#124;&#124; [];
           var button = new Ext.Button({text:"Ok", width:50});
           config.items.push(button);
           StatePanel.superclass.constructor.call(config, this);
           button.on("click", this.onClick, this);
        },
   </code>
</pre>
<p>&#160;The next concerns are view and controller where the controller is the &#8220;StateHandler&#8221; and view is &#8220;Ext.Panel&#8221;. This approach will evolve your architecture in future. Though it cannot be considered as remedy. You cannot apply it to everywhere, for instance, a gender control. I wouldn&#8217;t implement controller and builder for it I would rather implement &#8220;Preconfigured class&#8221;.</p>
<pre>
  <code>
 Ext.extend( Ext.form.ComboBox, {
      typeAhead: true,
      triggerAction: 'all',
      lazyRender:true,
      mode: 'local',

   constructor :function(){
       var male = "male";
       var female = "female";
   }

});

</code>
 </pre>
<p> &#160;I call such component the &#8220;primitive component&#8221;. It&#8217;s not worth to apply builder and controller as separate classes. It is pretty enough to pre-configure. I don&#8217;t believe that the gender component will ever grow. In other words if it&#8217;s simple per se, don&#8217;t add extra complexity. It is not worth to segregate extra classes to highlight their relationships.</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[3rd Scheduler webcast - Creating a simple Gantt chart]]></title>
<link>http://mankzblog.wordpress.com/2009/10/21/3rd-scheduler-webcast-creating-a-simple-gantt-chart/</link>
<pubDate>Wed, 21 Oct 2009 08:57:10 +0000</pubDate>
<dc:creator>Mats Bryntse</dc:creator>
<guid>http://mankzblog.wordpress.com/2009/10/21/3rd-scheduler-webcast-creating-a-simple-gantt-chart/</guid>
<description><![CDATA[Here&#8217;s another short webcast showing how you can turn the scheduler into a simple Gantt chart ]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Here&#8217;s another short webcast showing how you can turn the scheduler into a simple Gantt chart easily.</p>
<p><a href="http://www.youtube.com/watch?v=4hfMvvhPfZ4"><img alt="" src="http://www.ext-scheduler.com/img/video1.png" title="Link" class="alignnone" width="150" height="120" /></a></p>
<p>Enjoy!</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Adding a red asterisk to the required form fields]]></title>
<link>http://wtcindia.wordpress.com/2009/10/20/adding-a-red-asterisk-to-the-required-form-fields/</link>
<pubDate>Tue, 20 Oct 2009 17:48:48 +0000</pubDate>
<dc:creator>wtcindia</dc:creator>
<guid>http://wtcindia.wordpress.com/2009/10/20/adding-a-red-asterisk-to-the-required-form-fields/</guid>
<description><![CDATA[In the application development, there are instances when we have to indicate a mandatory form field ]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>In the application development, there are instances when we have to indicate a mandatory form field by showing a red asterisk next to the field label. </p>
<div id="attachment_336" class="wp-caption aligncenter" style="width: 305px"><a href="http://wtcindia.wordpress.com/2009/10/20/adding-a-red-asterisk-to-the-required-form-fields/red_asterisk/" rel="attachment wp-att-336"><img src="http://wtcindia.wordpress.com/files/2009/10/red_asterisk.png" alt="Mandatory field with red asterisk" title="Mandatory field with red asterisk" width="295" height="57" class="size-full wp-image-336" /></a><p class="wp-caption-text">Mandatory field with red asterisk</p></div>
<p>The code here overrides the private function of the <em>Ext.form.FormLayout</em> and works with a custom property <strong>required</strong>. I chose the form layout as the rendering of the labels is taken care by this layout. Other option was to use the allowBlank property but just to keep things simple I have used the custom config required.</p>
<p><strong>For ExtJS version 2.2.x</strong></p>
<p><code><br />
    Ext.override(Ext.layout.FormLayout, {<br />
       renderItem : function(c, position, target){<br />
            if(c &#38;&#38; !c.rendered &#38;&#38; c.isFormField &#38;&#38; c.inputType != 'hidden'){<br />
            var labelSep = typeof c.labelSeparator == 'undefined' ? this.labelSeparator : c.labelSeparator;<br />
            if (c.required) labelSep += '&#60;span style="color: rgb(255, 0, 0); padding-left: 2px;"&#62;*&#60;/span&#62;';</p>
<p>                var args = [<br />
                       c.id, c.fieldLabel,<br />
                       this.getLabelStyle(c.labelStyle),<br />
                       this.elementStyle&#124;&#124;'',<br />
                       labelSep,<br />
                       (c.itemCls&#124;&#124;this.container.itemCls&#124;&#124;'') + (c.hideLabel ? ' x-hide-label' : ''),<br />
                       c.clearCls &#124;&#124; 'x-form-clear-left'<br />
                ];<br />
                if(typeof position == 'number'){<br />
                    position = target.dom.childNodes[position] &#124;&#124; null;<br />
                }<br />
                if(position){<br />
                    this.fieldTpl.insertBefore(position, args);<br />
                }else{<br />
                    this.fieldTpl.append(target, args);<br />
                }<br />
                c.render('x-form-el-'+c.id);<br />
            }else {<br />
                Ext.layout.FormLayout.superclass.renderItem.apply(this, arguments);<br />
            }<br />
        }<br />
    });<br />
</code></p>
<p><strong>For ExtJs version 3.0.x</strong><br />
<code><br />
    Ext.override(Ext.layout.FormLayout, {<br />
    getTemplateArgs: function(field) {<br />
            var noLabelSep = !field.fieldLabel &#124;&#124; field.hideLabel;<br />
            var labelSep = (typeof field.labelSeparator == 'undefined' ? this.labelSeparator : field.labelSeparator);<br />
            if (field.required) labelSep += '&#60;span style="color: rgb(255, 0, 0); padding-left: 2px;"&#62;*&#60;/span&#62;';<br />
            return {<br />
                id: field.id,<br />
                label: field.fieldLabel,<br />
                labelStyle: field.labelStyle&#124;&#124;this.labelStyle&#124;&#124;'',<br />
                elementStyle: this.elementStyle&#124;&#124;'',<br />
                labelSeparator: noLabelSep ? '' : labelSep,<br />
                itemCls: (field.itemCls&#124;&#124;this.container.itemCls&#124;&#124;'') + (field.hideLabel ? ' x-hide-label' : ''),<br />
                clearCls: field.clearCls &#124;&#124; 'x-form-clear-left'<br />
            };<br />
        }<br />
    });<br />
</code></p>
<p>Following is a typical usage:<br />
{<br />
   fieldLabel: &#8216;Patient Id&#8217;,<br />
   xtype: &#8216;textfield&#8217;,<br />
   name:&#8217;patientId&#8217;,<br />
   <em>required: true</em><br />
}</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Ext JS]]></title>
<link>http://r5131n.wordpress.com/2009/10/20/ext-js/</link>
<pubDate>Tue, 20 Oct 2009 09:00:20 +0000</pubDate>
<dc:creator>r5131n</dc:creator>
<guid>http://r5131n.wordpress.com/2009/10/20/ext-js/</guid>
<description><![CDATA[Apa itu Ext JS ? Ext JS merupakan salah satu Framework yang digunakan untuk membuat website. Framewo]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Apa itu Ext JS ?</p>
<p>Ext JS merupakan salah satu Framework yang digunakan untuk membuat website. Framework yang dikembangkan oleh Jack Slocum mulai tahun 2006 ini terdiri dari library-library Javascript dan merupakan salah satu dari banyak tools yang digunakan untuk pengembangan software berbasis RIA (Rich Internet Application).</p>
<p>Dibawah ini adalah contoh pengembangan website dengan menggunakan Ext JS.</p>
<p><img class="aligncenter size-medium wp-image-128" title="formlogin" src="http://r5131n.wordpress.com/files/2009/10/formlogin.jpg?w=300" alt="formlogin" width="300" height="236" /></p>
<p>Artikel berikutnya kita akan membahas dan belajar bersama, bagaimana menggunakan Framework Ext JS.</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[ExtJS Tips &amp; Tricks: Making EditorGridPanel (Ext.grid.EditorGridPanel) readonly at runtime in Extjs]]></title>
<link>http://indiandeve.wordpress.com/2009/10/19/extjs-tips-tricks-making-editorgridpanel-ext-grid-editorgridpanel-read-only-at-run-time-in-extjs/</link>
<pubDate>Mon, 19 Oct 2009 16:49:05 +0000</pubDate>
<dc:creator>falaque</dc:creator>
<guid>http://indiandeve.wordpress.com/2009/10/19/extjs-tips-tricks-making-editorgridpanel-ext-grid-editorgridpanel-read-only-at-run-time-in-extjs/</guid>
<description><![CDATA[I was wondering how i could make EditorGridPanel readonly at runtime. Finally I managed to find out ]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>I was wondering how i could make EditorGridPanel readonly at runtime. Finally I managed to find out a way to do this. What you have to do is register an handler for grid&#8217;s beforeedit event which will return false !!!</p>
<p>say, you need a function which will do this:</p>
<div style="background:#f1f1f1;border:1px dashed #333333;padding:10px;">
<pre style="font-size:130%;"><span style="color:#008000;">//handler function for ‘beforeedit’ event</span>
<span style="color:#333399;">function </span>handler_to_makeReadOnly(){<span style="color:#333399;">return false</span>;}
<span style="color:#008000;">//function to make EditorGridPanel read only</span>
<span style="color:#333399;">function </span>MakeEditorGridPanelReadOnly(editorGridPanel)
{
	editorGridPanel.on(‘beforeedit’
  ,handler_to_makeReadOnly,this);
}
<span style="color:#008000;">//function to make EditorGridPanel normal(editable)</span>
<span style="color:#333399;">function </span>MakeEditorGridPanelUnReadOnly(editorGridPanel)
{
	editorGridPanel.un(‘beforeedit’
  ,handler_to_makeReadOnly,this);
}
</pre>
</div>
<p><strong>Note:</strong> MakeEditorGridPanelUnReadOnly will just remove the effect of MakeEditorGridPanelReadOnly function by unregistering the handler handler_to_makeReadOnly. If grid column models are read only it wont change them, means those columns will still be read only.</p>
<p>If you find any problem just write a comment to reach me.<br />
<em><br />
<span style="text-decoration:underline;">Modification History:</span></em></p>
<p><em>1. 05 Nov 2009: Made the code block proper.<br />
</em></p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Leaving in the morning for CFINNC!]]></title>
<link>http://cfmeta.net/2009/10/15/leaving-in-the-morning-for-cfinnc/</link>
<pubDate>Thu, 15 Oct 2009 16:04:31 +0000</pubDate>
<dc:creator>bchesley</dc:creator>
<guid>http://cfmeta.net/2009/10/15/leaving-in-the-morning-for-cfinnc/</guid>
<description><![CDATA[Need more AIR, ORM, and ExtJS with CF!]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p><a href="http://cfinnc.com" title="CFinNC - Carolina ColdFusion / Flex / Air Conference - Oct 17-18, 2009"><img src="http://cfinnc.com/2009/cfinnc-180x100-attending.gif" border="0"></a></p>
<p>Need more AIR, ORM, and ExtJS with CF!</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[ExtJs session expiration, a better approach]]></title>
<link>http://emptylist.wordpress.com/2009/10/11/extjs-session-expiration-a-better-approach/</link>
<pubDate>Sun, 11 Oct 2009 09:53:49 +0000</pubDate>
<dc:creator>Andrea Cerisara</dc:creator>
<guid>http://emptylist.wordpress.com/2009/10/11/extjs-session-expiration-a-better-approach/</guid>
<description><![CDATA[Just want to write down the result of another spike regarding session expiration. I&#8217;d be glad ]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p style="text-align:justify;">Just want to write down the result of another spike regarding session expiration. I&#8217;d be glad to know from skilled guys out there what are the best practices to solve this problem. Anyway, you can return from the session filter a JSON (or XML or anything else supported) result using the usual <em>sendRedirect </em>method of <em>HttpServletResponse</em> interface. The result can contain a code indicating the type of error occurred:</p>
<pre class="brush: xml;">
{ success: false, code: 1, results: [] }
</pre>
<p style="text-align:justify;">All you have to do is setup a base standard Store, adding a listener to the <em>exception</em> event:</p>
<pre class="brush: jscript;">
MyStore = Ext.extend(Ext.data.Store,
{
    reader = new Ext.data.JsonReader(
    {
        root : &#34;results&#34;,
        successProperty : &#34;success&#34;, // default
        fields : [ &#34;field1&#34;, &#34;field2&#34;, ... ]
    },
    listeners : {
        &#34;exception&#34; : {
            fn : function(proxy, type, action, options, response, arg)
            {
                // just a spike, needs a structured design for all cases...
                if (type == &#34;remote&#34; &#38;&#38; response.code == 1)
                {
                    window.location = &#34;sessionExpiredResource&#34;;
                }
            }
        }
    }
});
</pre>
<p style="text-align:justify;">The listener is called if an error occurred during a remote request, being a low level server error (the <strong>type</strong> parameter is set to <em>response</em>) or an application error (<strong>successProperty</strong> === false and type parameter set to <em>remote</em>). In this latter case the <strong>response</strong> parameter contains the decoded response object sent from the server, so you can access and test the <em>code</em> flag indicating the type of application error occurred. The same must be done for all forms in the application, maybe customizing the <em>options</em> object passed to the forms&#8217; <strong>submit</strong> method or extending the base FormPanel component.</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[ExtJS 3.0 – Centralizar elemento na tela]]></title>
<link>http://dotinfo.wordpress.com/2009/10/08/extjs-3-0-%e2%80%93-centralizar-elemento-na-tela/</link>
<pubDate>Thu, 08 Oct 2009 19:43:30 +0000</pubDate>
<dc:creator>Everton da Rosa</dc:creator>
<guid>http://dotinfo.wordpress.com/2009/10/08/extjs-3-0-%e2%80%93-centralizar-elemento-na-tela/</guid>
<description><![CDATA[Mais um exemplo usando ExtJS 3.0, agora mesclado com Javascript &#8220;normal&#8221;. A função receb]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Mais um exemplo usando <a href="http://extjs.com">ExtJS 3.0</a>, agora mesclado com Javascript &#8220;normal&#8221;.<br />
A função recebe um id de elemento (panel, form, grid, etc) criado com extjs e posiciona ele no meio da tela.</p>
<p>Pode ser adaptada facilmente para receber o próprio objeto em vez da id.</p>
<p><code>//Função que centraliza na tela um Panel, Form, Grid, etc contruído com ExtJS independente do tamanho do objeto e da resolução da tela. O parâmetro id recebe o id do elemento.<br />
function centerOnScreen(id){<br />
var elx = Ext.get(id);//pega o elemento ext<br />
var fw = elx.getWidth();//pega a largura do elemento<br />
var fh = elx.getHeight();//pega a altura do elemento<br />
var sw = screen.width;//pega a largura da tela<br />
var sh = screen.height;//pega a altura da tela<br />
var pt = (sh-fh)/4;//calcula distância do topo<br />
var pl = (sw-fw)/2;//calcula distância do lado esquerdo<br />
var el = document.getElementById(id);//pega o elemento DOM<br />
el.style.position = 'absolute';//define como posição absoluta<br />
el.style.top = pt + 'px';//define distãncia do topo<br />
el.style.left = pl + 'px';//define distância da margem esquerda<br />
}<br />
</code></p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[ExtJs session expiration]]></title>
<link>http://emptylist.wordpress.com/2009/10/08/extjs-session-expiration/</link>
<pubDate>Thu, 08 Oct 2009 19:25:27 +0000</pubDate>
<dc:creator>Andrea Cerisara</dc:creator>
<guid>http://emptylist.wordpress.com/2009/10/08/extjs-session-expiration/</guid>
<description><![CDATA[The issue here is to redirect the user to a custom page when the session is expired, using the ExtJs]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p style="text-align:justify;">The issue here is to redirect the user to a custom page when the session is expired, using the ExtJs Ajax framework. I&#8217;m generally used to redirect to a static html page (through the <em>sendRedirect</em> method of <em>HttpServletResponse</em> interface), but within an ExtJs environment this doesn&#8217;t work:</p>
<ul>
<li>the component calls a server-side object to obtain or to push some data</li>
<li>the filter recognizes that session is expired and it sends a 302 status code to the browser</li>
<li>the browser sends a GET request to the resource obtained through the <em>Location</em> header of the previous response</li>
<li>the component tries to parse the data received, and it fails since it is not correctly formatted</li>
</ul>
<p style="text-align:justify;">A <em>quick&#38;dirty</em> solution is to return a different http code using the <em>sendError</em> method instead (I used 400 in my spike, but it&#8217;s terrible):</p>
<pre class="brush: java;">
...
if (sessionExpired())
{
    response.sendError(HttpServletResponse.SC_BAD_REQUEST);
}
...
</pre>
<p style="text-align:justify;">And then intercept the failure through a listener added to the <em>Ext.Ajax</em> singleton (being a singleton used by all remote connections, you can define the listener only once during the application startup):</p>
<pre class="brush: jscript;">
Ext.Ajax.on(&#34;requestexception&#34;, function(connection, response, options)
{
    if (sessionExpiredCode == response.status)
    {
        window.location = &#34;sessionExpiredResource&#34;;
    }
    else
    {
        // do something, like showing an error box for other cases...
    }
});
</pre>
<p style="text-align:justify;">It works, but it&#8217;s quite ugly, because an application error is handled through low level http codes. I don&#8217;t have time to try it, but probably returning a specific JSON result from the session filter would be a better idea.</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Ext-Scheduler is now official]]></title>
<link>http://mankzblog.wordpress.com/2009/10/08/my-pet-project-is-now-official/</link>
<pubDate>Thu, 08 Oct 2009 09:15:58 +0000</pubDate>
<dc:creator>Mats Bryntse</dc:creator>
<guid>http://mankzblog.wordpress.com/2009/10/08/my-pet-project-is-now-official/</guid>
<description><![CDATA[I&#8217;ve been working on a project for a while and now I feel it&#8217;s stable enough to go publi]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>I&#8217;ve been working on a project for a while and now I feel it&#8217;s stable enough to go public with it. It&#8217;s a javascript based scheduler built upon the lovely ExtJS framework. I&#8217;ll be posting updates and implementation details in upcoming posts.</p>
<p>Check out the<strong> <a href="http://www.extjs.com/forum/showthread.php?p=395499#post395499">forum thread</a></strong> or go directly to the webcast.</p>
<p><span style='text-align:center; display: block;'><object width='425' height='350'><param name='movie' value='http://www.youtube.com/v/xnIlF_Xjfp0&#038;rel=1&#038;fs=1&#038;showsearch=0&#038;hd=0' /><param name='allowfullscreen' value='true' /><param name='wmode' value='transparent' /><embed src='http://www.youtube.com/v/xnIlF_Xjfp0&#038;rel=1&#038;fs=1&#038;showsearch=0&#038;hd=0' type='application/x-shockwave-flash' allowfullscreen='true' width='425' height='350' wmode='transparent'></embed></object></span></p>
<p><a href="http://www.ext-scheduler.com">Project homepage</a></p>
<p>Feedback or ideas welcome! <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Utilisation d'ExtJS par Activ Browser pour le développement de RIA]]></title>
<link>http://businessweb-blog.com/2009/10/08/utililsation-dextjs-par-activ-browser-pour-le-developpement-de-ria/</link>
<pubDate>Thu, 08 Oct 2009 08:01:26 +0000</pubDate>
<dc:creator>Adrien</dc:creator>
<guid>http://businessweb-blog.com/2009/10/08/utililsation-dextjs-par-activ-browser-pour-le-developpement-de-ria/</guid>
<description><![CDATA[Ext est une bibliothèque  Javascript permettant de construire des applications web interactives. C]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p><strong>Ext</strong> est une bibliothèque <a href="http://fr.wikipedia.org/wiki/Javascript" target="_blank"><span style="color:#000000;font-weight:bold;text-decoration:underline;"> </span></a><strong>Javascript</strong> permettant de construire des <a href="http://www.activbrowser.com/" target="_blank"><strong>applications web interactives</strong></a>. C&#8217;était au départ une extension à la bibliothèque Javascript YUI<a href="http://fr.wikipedia.org/wiki/Javascript" target="_blank"><span style="color:#000000;text-decoration:underline;"> </span></a><a href="http://fr.wikipedia.org/wiki/YUI" target="_blank"><span style="color:#000000;text-decoration:underline;"> </span></a> de Yahoo<a href="http://fr.wikipedia.org/wiki/Yahoo" target="_blank"><span style="color:#000000;text-decoration:underline;"> </span></a>, Ext peut maintenant être utilisée avec les bibliothèques Prototype, JQuery ou encore toute seule. Ext apporte un certain nombre de <strong>composants visuels d&#8217;une grande qualité</strong> comme des champs de formulaires avancés, des arbres, des tableaux, menu et barre d&#8217;outils, onglets, boites de dialogue.</p>
<p>De grands noms l&#8217;utilisent déjà comme <a href="http://www.adobe.com/" target="_blank">Adobe</a>, <a href="http://www.adobe.com/" target="_blank">IBM</a>, <a href="http://w1.siemens.com/entry/cc/en/" target="_blank">Siemens</a>, <a href="http://www.station.sony.com/sonyonline/" target="_blank">Sony Online Entertainment,</a> etc&#8230;</p>
<p>Même si le développement de <strong>RIA</strong> par <a href="http://www.activbrowser.com/" target="_blank"><strong>Activ Browser</strong></a> est réalisé également avec d&#8217;autres frameworks, <strong>le framework ExtJS </strong>se montre particulièrement <strong>puissant</strong>.</p>
<div id="attachment_470" class="wp-caption aligncenter" style="width: 258px"><img class="size-full wp-image-470" title="extjs_logo" src="http://ebusinessisfun.wordpress.com/files/2009/10/extjs_logo.gif" alt="logo estJS" width="248" height="48" /><p class="wp-caption-text">logo ExtJS</p></div>
<p><em>Sources: http://www.javascriptfr.com/tutoriaux/EXTJS-MINI-TUTO-INTERRACTION-AVEC-BASE-DONNEES_853.aspx<br />
http://blog.jflad.com/post/Presentation-Ext-JS-Encore-un-framework-Javascript</em></p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Sorting in a grid panel]]></title>
<link>http://wtcindia.wordpress.com/2009/10/08/sorting-in-a-grid-panel/</link>
<pubDate>Thu, 08 Oct 2009 03:52:10 +0000</pubDate>
<dc:creator>wtcindia</dc:creator>
<guid>http://wtcindia.wordpress.com/2009/10/08/sorting-in-a-grid-panel/</guid>
<description><![CDATA[While grid allows us to make one or more columns sortable (through the sortable configuration of Ext]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>While grid allows us to make one or more columns sortable (through the sortable configuration of Ext.grid.ColumnModel class). However, it just performs client side sorting in ascending or descending order. It does not perform sorting with respect to values in some other column. For example if I want to sort on prices of the articles in the same brand then simple grid sorting does not allow you to achieve that grouping. This is where ExtJS provides you GroupingStore, which enables you to view related items together and view them shorted as well!</p>
<p>The Class Ext.data.GroupingStore is similar to normal store, except that it provides few  additional configurations:<br />
<strong>groupField</strong> &#8212; The field name by which to sort the store&#8217;s data<br />
<strong>groupOnSort</strong> &#8212; True to sort the data on the grouping field when a grouping operation occurs, false to sort based on the existing sort info</p>
<p>The GroupingStore is often used in conjunction with an Ext.grid.GroupingView to provide the data model for a grouped GridPanel. All you need to do is to define following configuration in GridPanel:<br />
view: new Ext.grid.GroupingView()</p>
<p>Ext.grid.GroupingView is extended from Ext.grid.GridView and it allows you to minimize maximize all the items in a group within the grid panel. On top of this, if you add the usual components like tool bar (with your buttons of choices) and paging bar and check boxes and you have such a rich interface. ExtJS you beauty! </p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[ExtJS 3.0 – Formulário com ComboBox e mensagens de validação]]></title>
<link>http://dotinfo.wordpress.com/2009/10/07/extjs-3-0-%e2%80%93-formulario-com-combobox-e-mensagens-de-validacao/</link>
<pubDate>Wed, 07 Oct 2009 19:53:36 +0000</pubDate>
<dc:creator>Everton da Rosa</dc:creator>
<guid>http://dotinfo.wordpress.com/2009/10/07/extjs-3-0-%e2%80%93-formulario-com-combobox-e-mensagens-de-validacao/</guid>
<description><![CDATA[Este artigo tem a intenção de mostrar um formulário feito com ExtJS com as seguintes características]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Este artigo tem a intenção de mostrar um formulário feito com <a href="http://www.extjs.com/">ExtJS</a> com as seguintes características:</p>
<ul>
<li>Possui um ComboBox que busca seus valores em uma página PHP e possui autocomplete dos valores possíveis.</li>
<li>Envia os dados por AJAX.</li>
<li>Apresenta para cada campo, mensagens sobre a validação server-side dos dados enviados.</li>
</ul>
<p>A motivação em escrever este pequeno artigo está no fato de que eu “penei” para conseguir compor um formulário com essas características, embora seja algo simples.</p>
<p>Por isso, quero compartilhar esse conhecimento adquirido com muitas horas de estudo e pesquisa, para que outros programadores não sofram tanto quanto eu.</p>
<p>A didática deste artigo será a seguinte:</p>
<p>Vou apresentar o código de cada arquivo com comentários sobre cada parte relevante.</p>
<p>Quero também ressaltar que os arquivos PHP contém código apenas para fornecer os dados necessários para este artigo, portanto, tem validade didática também.</p>
<p>O primeiro arquivo é dados_login.php, que nada mais faz do que fornecer uma saída JSON com os valores que irão aparecer no ComboBox.</p>
<p>&#60;?php</p>
<p>$json = &#8216;{//Este é um array que contém uma string JSON com os valores dos campos id e sistema. No caso são 3 valores.</p>
<p>rows: [</p>
<p>{id: "1", sistema: "Contabilidade"}</p>
<p>,{id: "2", sistema: "Tesouraria"}</p>
<p>,{id: "3", sistema: "Compras"}</p>
<p>]</p>
<p>}&#8217;;</p>
<p>echo $json; //Aqui imprimimos a string JSON para o retorno ao Ext.</p>
<p>?&#62;</p>
<p>Em seguida, temos o arquivo do formulário propriamente dito: login.php. Este arquivo contém as inclusões das bibliotecas e CSS do Ext, bem como o código do formulário (preferi colocá-lo dentro do arquivo principal, ao invés de fazer um arquivo separado).</p>
<p>&#60;!DOCTYPE HTML PUBLIC &#8220;-//W3C//DTD HTML 4.01//EN&#8221; &#8220;http://www.w3.org/TR/html4/strict.dtd&#8221;&#62;</p>
<p>&#60;html&#62;</p>
<p>&#60;head&#62;</p>
<p>&#60;meta http-equiv=&#8221;Content-Type&#8221; content=&#8221;text/html; charset=utf-8&#8243;&#62;</p>
<p>&#60;title&#62;Formulário de login&#60;/title&#62;</p>
<p>&#60;link rel=&#8221;stylesheet&#8221; href=&#8221;ext-3.0.0/resources/css/ext-all.css&#8221;/&#62;</p>
<p>&#60;!&#8211; GC &#8211;&#62;</p>
<p>&#60;!&#8211; LIBS &#8211;&#62;</p>
<p>&#60;script type=&#8221;text/javascript&#8221; src=&#8221;ext-3.0.0/adapter/ext/ext-base.js&#8221;&#62;&#60;/script&#62;</p>
<p>&#60;!&#8211; ENDLIBS &#8211;&#62;</p>
<p>&#60;script type=&#8221;text/javascript&#8221; src=&#8221;ext-3.0.0/ext-all.js&#8221;&#62;&#60;/script&#62;</p>
<p>&#60;script type=&#8221;text/javascript&#8221; src=&#8221;crb-config.js&#8221;&#62;&#60;/script&#62;</p>
<p>//Início do nosso script</p>
<p>&#60;script type=&#8221;text/javascript&#8221;&#62;</p>
<p>Ext.onReady(function(){//Inicia o script assim que todo o documento estiver carregado</p>
<p>//Inicia a exibição de mensagens</p>
<p>Ext.QuickTips.init();</p>
<p>//Configura o local onde as mesnagens serão exibidas</p>
<p>Ext.form.Field.prototype.msgTarget = “under”;</p>
<p>//Inicia a recuperação dos dados sobre os sistemas</p>
<p>var store = new Ext.data.JsonStore({</p>
<p>url: &#8216;dados_login.php&#8217;,//caminho da página que fornecerá os dados para o ComboBox</p>
<p>root: &#8216;rows&#8217;,//Indica qual a “raiz” que contém os dados</p>
<p>fields: ['id', 'sistema'] //Indica os campos dos dados</p>
<p>});</p>
<p>store.load();//Carrega os dados</p>
<p>//Formulário de login</p>
<p>var formLogin = new Ext.FormPanel({</p>
<p>renderTo: &#8216;container1&#8242;//Indica onde o formulário será renderizado</p>
<p>,frame: true//Bordas arredondadas</p>
<p>,title: &#8216;Entrar no sistema&#8217;</p>
<p>,bodyStyle: &#8216;padding: 20px 20px 20px 20px&#8217;</p>
<p>,buttonAlign: &#8216;right&#8217;</p>
<p>,width: 400</p>
<p>,height: 250</p>
<p>,waitMsgTarget: true//Exibe mensagem ao submeter o formulário</p>
<p>,buttons: [//Configuração dos botões do formulário</p>
<p>new Ext.Button({//Botão de limpar o formulário</p>
<p>icon: 'ext-3.0.0/resources/images/default/menu/unchecked.gif'</p>
<p>,iconAlign: 'left'</p>
<p>,text: 'Limpar'</p>
<p>,tooltip: 'Limpar dados digitados'</p>
<p>,type: 'reset'</p>
<p>,handler: function(){</p>
<p>formLogin.getForm().reset();</p>
<p>}</p>
<p>})</p>
<p>,new Ext.Button({//Botão de enviar o formulário</p>
<p>icon: 'ext-3.0.0/resources/images/default/menu/checked.gif'</p>
<p>,iconAlign: 'left'</p>
<p>,text: 'Entrar'</p>
<p>,tooltip: 'Entrar no sistema selecionado'</p>
<p>,type: 'submit'</p>
<p>//Função para envio dos dados</p>
<p>,handler: function(){</p>
<p>formLogin.getForm().submit({</p>
<p><a href="%27logar.php%27//Endere%C3%A7o">url:'logar.php'//Endereço</a> do arquivo que receberá os dados</p>
<p>,method: 'POST'</p>
<p>,waitMsg:'Por favor, aguarde...'</p>
<p>,success: function(){</p>
<p>Ext.Msg.alert('Status','Login com sucesso');</p>
<p>}</p>
<p>});</p>
<p>}</p>
<p>})</p>
<p>]</p>
<p>,items: [</p>
<p>new Ext.form.ComboBox({//Nosso ComboBox</p>
<p>name: 'sistema'//Nome do campo</p>
<p>,fieldLabel: 'Sistemas'</p>
<p>,mode: 'local'//Indica que o campo será preenchido com os dados ao carregar o formulário.</p>
<p>,displayField: 'sistema'//Indica qual campo será mostrado no ComboBox</p>
<p>,valueField: 'id' //especifica qual o campo que terá seu valor submetido</p>
<p>,hiddenName: 'id' //especifica um nome de campo que será enviado com o valor em valueField</p>
<p>,store: store//Os dados para preencher o ComboBox</p>
<p>,labelSeparator: ':'</p>
<p>,width: 200</p>
<p>,emptyText: 'Selecione ou digite o sistema'</p>
<p>,forceSelection: true //Permite que somente os dados existentes no campo seja utilizados</p>
<p>,typeAhead: true//Preenche o campo com sugestões ao digitar</p>
<p>})</p>
<p>,new Ext.form.TextField({//Campo de texto para usuário</p>
<p>name: 'usuario'</p>
<p>,fieldLabel: 'Usuário'</p>
<p>,width: 200</p>
<p>,emptyText: 'Informe seu nome de usuário'</p>
<p>})</p>
<p>,new Ext.form.TextField({//Campo de texto para senha</p>
<p>name: 'senha'</p>
<p>,fieldLabel: 'Senha'</p>
<p>,width: 200</p>
<p>,inputType: 'password'</p>
<p>})</p>
<p>]</p>
<p>});</p>
<p>//Posiciona o formulário no centro da tela</p>
<p>var container1  = document.getElementById(&#8216;container1&#8242;);</p>
<p>container1.style.height = formLogin.height + &#8216;px&#8217;;</p>
<p>container1.style.width = formLogin.width + &#8216;px&#8217;;</p>
<p>var spaceup = (screen.height &#8211; container1.style.height.replace(&#8216;px&#8217;,&#8221;))/4;</p>
<p>var spaceleft = (screen.width &#8211; container1.style.width.replace(&#8216;px&#8217;,&#8221;))/2;</p>
<p>container1.style.marginTop = spaceup + &#8216;px&#8217;;</p>
<p>container1.style.marginLeft = spaceleft + &#8216;px&#8217;;</p>
<p>});</p>
<p>&#60;/script&#62;</p>
<p>&#60;/head&#62;</p>
<p>&#60;body&#62;</p>
<p>&#60;div&#62;&#60;/div&#62;</p>
<p>&#60;/body&#62;</p>
<p>&#60;/html&#62;</p>
<p>Por fim, o arquivo logar.php é que faz a validação dos dados e informa se houve sucesso ou falha, neste caso informando os campos e os erros.</p>
<p>&#60;?php</p>
<p>//Uma pequena configuração dos dados válidos</p>
<p>$u = &#8216;root&#8217;;</p>
<p>$s = &#8216;123&#8242;;</p>
<p>$sis = &#8216;1&#8242;;</p>
<p>$sistema = $_POST['id'];</p>
<p>$usuario = $_POST['usuario'];</p>
<p>$senha = $_POST['senha'];</p>
<p>Verifica se os dados enviados correspondem aos dados válidos, senão, indica o erro</p>
<p>if($usuario != $u){</p>
<p>$errors['usuario'] = &#8216;usuário não confere&#8217;;</p>
<p>$result = false;</p>
<p>}</p>
<p>if($senha != $s){</p>
<p>$errors['senha'] = &#8217;senha não confere&#8217;;</p>
<p>$result = false;</p>
<p>}</p>
<p>//Observe que na validação a seguir, o erro deve ser informado com o campo id, o mesmo informado no valor hiddenName, senão, nãos era exibida a mensagem de erro para o ComboBox</p>
<p>if($sistema != $sis){</p>
<p>$errors['id'] = &#8217;sistema não confere&#8217;;</p>
<p>$result = false;</p>
<p>}else{</p>
<p>$result = true;</p>
<p>}</p>
<p>if($result){</p>
<p>$o = array(&#8220;success&#8221;=&#62;true);</p>
<p>}else{</p>
<p>$o = array(&#8217;success&#8217;=&#62;false,&#8217;errors&#8217;=&#62;$errors);</p>
<p>}</p>
<p>//Retorno dos dados à página principal</p>
<p>header(&#8220;Content-Type: application/json&#8221;);</p>
<p>echo json_encode($o);</p>
<p>?&#62;</p>
<p>O funcionamento deste código é o seguinte:</p>
<p>O usuário pode digitar o nome do sistema desejado (verifique o autocomplete do ComboBox) ou selecioná-lo na lista apresentada, informar um nome de usuário e uma senha. Se os dados conferem com os dados válidos, é exibida uma mensagem de sucesso, senão, são exibidas mensagens de erro abaixo dos campos com problemas.</p>
<p>Espero que este pequeno artigo ajude àqueles que desejam trabalhar com ExtJS.</p>
<p>Um especial agradecimento à <a href="http://www.extjs.com.br/">comunidade brasileira dos utilizadores do ExtJS</a> e ao site <a href="http://examples.extjs.eu/">Saki’s Ext Examples</a>.</p>
</div>]]></content:encoded>
</item>

</channel>
</rss>
