Upgrade to ExtJS 4.0.1 - Released 05/18/2011
[extjs.git] / docs / source / Action3.html
index f0fbc42..14eceeb 100644 (file)
@@ -1,4 +1,21 @@
-<!DOCTYPE html><html><head><title>Sencha Documentation Project</title><link rel="stylesheet" href="../reset.css" type="text/css"><link rel="stylesheet" href="../prettify.css" type="text/css"><link rel="stylesheet" href="../prettify_sa.css" type="text/css"><script type="text/javascript" src="../prettify.js"></script></head><body onload="prettyPrint()"><pre class="prettyprint"><pre><span id='Ext-grid.column.Action'>/**
+<!DOCTYPE html>
+<html>
+<head>
+  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+  <title>The source code</title>
+  <link href="../prettify/prettify.css" type="text/css" rel="stylesheet" />
+  <script type="text/javascript" src="../prettify/prettify.js"></script>
+  <style type="text/css">
+    .highlight { display: block; background-color: #ddd; }
+  </style>
+  <script type="text/javascript">
+    function highlight() {
+      document.getElementById(location.hash.replace(/#/, "")).className = "highlight";
+    }
+  </script>
+</head>
+<body onload="prettyPrint(); highlight();">
+  <pre class="prettyprint lang-js"><span id='Ext-grid-column-Action'>/**
 </span> * @class Ext.grid.column.Action
  * @extends Ext.grid.column.Column
  * &lt;p&gt;A Grid header type which renders an icon, or a series of icons in a grid cell, and offers a scoped click
@@ -57,16 +74,16 @@ Ext.define('Ext.grid.column.Action', {
     alias: ['widget.actioncolumn'],
     alternateClassName: 'Ext.grid.ActionColumn',
 
-<span id='Ext-grid.column.Action-cfg-icon'>    /**
+<span id='Ext-grid-column-Action-cfg-icon'>    /**
 </span>     * @cfg {String} icon
      * The URL of an image to display as the clickable element in the column. 
      * Optional - defaults to &lt;code&gt;{@link Ext#BLANK_IMAGE_URL Ext.BLANK_IMAGE_URL}&lt;/code&gt;.
      */
-<span id='Ext-grid.column.Action-cfg-iconCls'>    /**
+<span id='Ext-grid-column-Action-cfg-iconCls'>    /**
 </span>     * @cfg {String} iconCls
      * A CSS class to apply to the icon image. To determine the class dynamically, configure the Column with a &lt;code&gt;{@link #getClass}&lt;/code&gt; function.
      */
-<span id='Ext-grid.column.Action-cfg-handler'>    /**
+<span id='Ext-grid-column-Action-cfg-handler'>    /**
 </span>     * @cfg {Function} handler A function called when the icon is clicked.
      * The handler is passed the following parameters:&lt;div class=&quot;mdetail-params&quot;&gt;&lt;ul&gt;
      * &lt;li&gt;&lt;code&gt;view&lt;/code&gt; : TableView&lt;div class=&quot;sub-desc&quot;&gt;The owning TableView.&lt;/div&gt;&lt;/li&gt;
@@ -77,18 +94,18 @@ Ext.define('Ext.grid.column.Action', {
      * &lt;li&gt;&lt;code&gt;e&lt;/code&gt; : Event&lt;div class=&quot;sub-desc&quot;&gt;The click event.&lt;/div&gt;&lt;/li&gt;
      * &lt;/ul&gt;&lt;/div&gt;
      */
-<span id='Ext-grid.column.Action-cfg-scope'>    /**
+<span id='Ext-grid-column-Action-cfg-scope'>    /**
 </span>     * @cfg {Object} scope The scope (&lt;tt&gt;&lt;b&gt;this&lt;/b&gt;&lt;/tt&gt; reference) in which the &lt;code&gt;{@link #handler}&lt;/code&gt;
      * and &lt;code&gt;{@link #getClass}&lt;/code&gt; fuctions are executed. Defaults to this Column.
      */
-<span id='Ext-grid.column.Action-cfg-tooltip'>    /**
+<span id='Ext-grid-column-Action-cfg-tooltip'>    /**
 </span>     * @cfg {String} tooltip A tooltip message to be displayed on hover. {@link Ext.tip.QuickTipManager#init Ext.tip.QuickTipManager} must have 
      * been initialized.
      */
-<span id='Ext-grid.column.Action-cfg-stopSelection'>    /**
+<span id='Ext-grid-column-Action-cfg-stopSelection'>    /**
 </span>     * @cfg {Boolean} stopSelection Defaults to &lt;code&gt;true&lt;/code&gt;. Prevent grid &lt;i&gt;row&lt;/i&gt; selection upon mousedown.
      */
-<span id='Ext-grid.column.Action-cfg-getClass'>    /**
+<span id='Ext-grid-column-Action-cfg-getClass'>    /**
 </span>     * @cfg {Function} getClass A function which returns the CSS class to apply to the icon image.
      * The function is passed the following parameters:&lt;ul&gt;
      *     &lt;li&gt;&lt;b&gt;v&lt;/b&gt; : Object&lt;p class=&quot;sub-desc&quot;&gt;The value of the column's configured field (if any).&lt;/p&gt;&lt;/li&gt;
@@ -103,7 +120,7 @@ Ext.define('Ext.grid.column.Action', {
      *     &lt;li&gt;&lt;b&gt;store&lt;/b&gt; : Ext.data.Store&lt;p class=&quot;sub-desc&quot;&gt;The Store which is providing the data Model.&lt;/p&gt;&lt;/li&gt;
      * &lt;/ul&gt;
      */
-<span id='Ext-grid.column.Action-cfg-items'>    /**
+<span id='Ext-grid-column-Action-cfg-items'>    /**
 </span>     * @cfg {Array} items An Array which may contain multiple icon definitions, each element of which may contain:
      * &lt;div class=&quot;mdetail-params&quot;&gt;&lt;ul&gt;
      * &lt;li&gt;&lt;code&gt;icon&lt;/code&gt; : String&lt;div class=&quot;sub-desc&quot;&gt;The url of an image to display as the clickable element 
@@ -135,7 +152,7 @@ Ext.define('Ext.grid.column.Action', {
 
     actionIdRe: /x-action-col-(\d+)/,
 
-<span id='Ext-grid.column.Action-cfg-altText'>    /**
+<span id='Ext-grid-column-Action-cfg-altText'>    /**
 </span>     * @cfg {String} altText The alt text to use for the image element. Defaults to &lt;tt&gt;''&lt;/tt&gt;.
      */
     altText: '',
@@ -152,7 +169,7 @@ Ext.define('Ext.grid.column.Action', {
 
         // This is a Container. Delete the items config to be reinstated after construction.
         delete cfg.items;
-        this.callParent([cfg]);
+        me.callParent([cfg]);
 
         // Items is an array property of ActionColumns
         me.items = items;
@@ -181,26 +198,30 @@ Ext.define('Ext.grid.column.Action', {
         return this.callParent(arguments);
     },
 
-<span id='Ext-grid.column.Action-method-processEvent'>    /**
+<span id='Ext-grid-column-Action-method-processEvent'>    /**
 </span>     * @private
      * Process and refire events routed from the GridView's processEvent method.
      * Also fires any configured click handlers. By default, cancels the mousedown event to prevent selection.
      * Returns the event handler's status to allow canceling of GridView's bubbling process.
      */
     processEvent : function(type, view, cell, recordIndex, cellIndex, e){
-        var m = e.getTarget().className.match(this.actionIdRe),
+        var me = this,
+            match = e.getTarget().className.match(me.actionIdRe),
             item, fn;
-        if (m &amp;&amp; (item = this.items[parseInt(m[1], 10)])) {
-            if (type == 'click') {
-                fn = item.handler;
-                if (fn || this.handler) {
-                    fn.call(item.scope||this.scope||this, view, recordIndex, cellIndex, item, e);
+        if (match) {
+            item = me.items[parseInt(match[1], 10)];
+            if (item) {
+                if (type == 'click') {
+                    fn = item.handler || me.handler;
+                    if (fn) {
+                        fn.call(item.scope || me.scope || me, view, recordIndex, cellIndex, item, e);
+                    }
+                } else if (type == 'mousedown' &amp;&amp; item.stopSelection !== false) {
+                    return false;
                 }
-            } else if ((type == 'mousedown') &amp;&amp; (item.stopSelection !== false)) {
-                return false;
             }
         }
-        return this.callParent(arguments);
+        return me.callParent(arguments);
     },
 
     cascade: function(fn, scope) {
@@ -211,4 +232,6 @@ Ext.define('Ext.grid.column.Action', {
     getRefItems: function() {
         return [];
     }
-});</pre></pre></body></html>
\ No newline at end of file
+});</pre>
+</body>
+</html>