sync
authorAlan Knowles <alan@roojs.com>
Fri, 9 Jul 2021 05:47:24 +0000 (13:47 +0800)
committerAlan Knowles <alan@roojs.com>
Fri, 9 Jul 2021 05:47:24 +0000 (13:47 +0800)
13 files changed:
buildSDK/dependancy_svg.txt [new file with mode: 0644]
docs/json/roodata.json
docs/src/Roo_grid_ColumnModel.js.html
docs/src/Roo_svg_Canvas.js.html [new file with mode: 0644]
docs/src/Roo_svg_Element.js.html [new file with mode: 0644]
docs/symbols/Roo.grid.ColumnModel.json
docs/symbols/Roo.json
roojs-all.js
roojs-bootstrap-debug.js
roojs-bootstrap.js
roojs-debug.js
roojs-ui-debug.js
roojs-ui.js

diff --git a/buildSDK/dependancy_svg.txt b/buildSDK/dependancy_svg.txt
new file mode 100644 (file)
index 0000000..b3ba46b
--- /dev/null
@@ -0,0 +1,2 @@
+Roo.svg.Canvas
+Roo.svg.Element
\ No newline at end of file
index 054a06e..bb52aa1 100644 (file)
         "static" : true,
         "memberOf" : ""
       },
-      {
-        "name" : "namespace",
-        "type" : "function",
-        "desc" : "Creates namespaces to be used for scoping variables and classes so that they are not global.  Usage:\n<pre><code>\nRoo.namespace('Company', 'Company.data');\nCompany.Widget = function() { ... }\nCompany.data.CustomStore = function(config) { ... }\n</code></pre>",
-        "sig" : "(namespace1, namespace2, etc)",
-        "static" : true,
-        "memberOf" : ""
-      },
       {
         "name" : "onReady",
         "type" : "function",
       }
     ],
     "methods" : [
+      {
+        "name" : "addColumn",
+        "type" : "function",
+        "desc" : "Add a column (experimental...) - defaults to adding to the end..",
+        "sig" : "(config)",
+        "static" : false,
+        "memberOf" : ""
+      },
       {
         "name" : "addEvents",
         "type" : "function",
index 6c3575a..9d78d67 100644 (file)
        </span><span class="jsdoc-comment">/**
      * The config passed into the constructor
      */
-    </span><span class="jsdoc-var">this.config </span><span class="jsdoc-syntax">= </span><span class="jsdoc-var">config</span><span class="jsdoc-syntax">;
+    </span><span class="jsdoc-var">this.config </span><span class="jsdoc-syntax">= []; </span><span class="jsdoc-comment">//config;
     </span><span class="jsdoc-var">this.lookup </span><span class="jsdoc-syntax">= {};
 
     </span><span class="jsdoc-comment">// if no id, create one
     // if the column does not have a dataIndex mapping,
     // map it to the order it is in the config
     </span><span class="jsdoc-keyword">for</span><span class="jsdoc-syntax">(</span><span class="jsdoc-keyword">var </span><span class="jsdoc-var">i </span><span class="jsdoc-syntax">= 0, </span><span class="jsdoc-var">len </span><span class="jsdoc-syntax">= </span><span class="jsdoc-var">config.length</span><span class="jsdoc-syntax">; </span><span class="jsdoc-var">i </span><span class="jsdoc-syntax">&lt; </span><span class="jsdoc-var">len</span><span class="jsdoc-syntax">; </span><span class="jsdoc-var">i</span><span class="jsdoc-syntax">++){
-        </span><span class="jsdoc-keyword">var </span><span class="jsdoc-var">c </span><span class="jsdoc-syntax">= </span><span class="jsdoc-var">config</span><span class="jsdoc-syntax">[</span><span class="jsdoc-var">i</span><span class="jsdoc-syntax">];
-        </span><span class="jsdoc-keyword">if</span><span class="jsdoc-syntax">(</span><span class="jsdoc-keyword">typeof </span><span class="jsdoc-var">c.dataIndex </span><span class="jsdoc-syntax">== </span><span class="jsdoc-string">&quot;undefined&quot;</span><span class="jsdoc-syntax">){
-            </span><span class="jsdoc-var">c.dataIndex </span><span class="jsdoc-syntax">= </span><span class="jsdoc-var">i</span><span class="jsdoc-syntax">;
-        }
-        </span><span class="jsdoc-keyword">if</span><span class="jsdoc-syntax">(</span><span class="jsdoc-keyword">typeof </span><span class="jsdoc-var">c.renderer </span><span class="jsdoc-syntax">== </span><span class="jsdoc-string">&quot;string&quot;</span><span class="jsdoc-syntax">){
-            </span><span class="jsdoc-var">c.renderer </span><span class="jsdoc-syntax">= </span><span class="jsdoc-var">Roo.util.Format</span><span class="jsdoc-syntax">[</span><span class="jsdoc-var">c.renderer</span><span class="jsdoc-syntax">];
-        }
-        </span><span class="jsdoc-keyword">if</span><span class="jsdoc-syntax">(</span><span class="jsdoc-keyword">typeof </span><span class="jsdoc-var">c.id </span><span class="jsdoc-syntax">== </span><span class="jsdoc-string">&quot;undefined&quot;</span><span class="jsdoc-syntax">){
-            </span><span class="jsdoc-var">c.id </span><span class="jsdoc-syntax">= </span><span class="jsdoc-var">Roo.id</span><span class="jsdoc-syntax">();
-        }
-        </span><span class="jsdoc-keyword">if</span><span class="jsdoc-syntax">(</span><span class="jsdoc-var">c.editor </span><span class="jsdoc-syntax">&amp;&amp; </span><span class="jsdoc-var">c.editor.xtype</span><span class="jsdoc-syntax">){
-            </span><span class="jsdoc-var">c.editor  </span><span class="jsdoc-syntax">= </span><span class="jsdoc-var">Roo.factory</span><span class="jsdoc-syntax">(</span><span class="jsdoc-var">c.editor</span><span class="jsdoc-syntax">, </span><span class="jsdoc-var">Roo.grid</span><span class="jsdoc-syntax">);
-        }
-        </span><span class="jsdoc-keyword">if</span><span class="jsdoc-syntax">(</span><span class="jsdoc-var">c.editor </span><span class="jsdoc-syntax">&amp;&amp; </span><span class="jsdoc-var">c.editor.isFormField</span><span class="jsdoc-syntax">){
-            </span><span class="jsdoc-var">c.editor </span><span class="jsdoc-syntax">= </span><span class="jsdoc-keyword">new </span><span class="jsdoc-var">Roo.grid.GridEditor</span><span class="jsdoc-syntax">(</span><span class="jsdoc-var">c.editor</span><span class="jsdoc-syntax">);
-        }
-        </span><span class="jsdoc-var">this.lookup</span><span class="jsdoc-syntax">[</span><span class="jsdoc-var">c.id</span><span class="jsdoc-syntax">] = </span><span class="jsdoc-var">c</span><span class="jsdoc-syntax">;
+       </span><span class="jsdoc-var">this.addColumn</span><span class="jsdoc-syntax">(</span><span class="jsdoc-var">config</span><span class="jsdoc-syntax">[</span><span class="jsdoc-var">i</span><span class="jsdoc-syntax">]);
+
     }
 
     </span><span class="jsdoc-comment">/**
      */
     </span><span class="jsdoc-var">setEditor </span><span class="jsdoc-syntax">: </span><span class="jsdoc-keyword">function</span><span class="jsdoc-syntax">(</span><span class="jsdoc-var">col</span><span class="jsdoc-syntax">, </span><span class="jsdoc-var">editor</span><span class="jsdoc-syntax">){
         </span><span class="jsdoc-var">this.config</span><span class="jsdoc-syntax">[</span><span class="jsdoc-var">col</span><span class="jsdoc-syntax">]</span><span class="jsdoc-var">.editor </span><span class="jsdoc-syntax">= </span><span class="jsdoc-var">editor</span><span class="jsdoc-syntax">;
+    },
+    </span><span class="jsdoc-comment">/**
+     * Add a column (experimental...) - defaults to adding to the end..
+     * @param {Object} config 
+    */
+    </span><span class="jsdoc-var">addColumn </span><span class="jsdoc-syntax">: </span><span class="jsdoc-keyword">function</span><span class="jsdoc-syntax">(</span><span class="jsdoc-var">c</span><span class="jsdoc-syntax">)
+    {
+
+       </span><span class="jsdoc-keyword">var </span><span class="jsdoc-var">i </span><span class="jsdoc-syntax">= </span><span class="jsdoc-var">this.config.length</span><span class="jsdoc-syntax">;
+       </span><span class="jsdoc-keyword">if</span><span class="jsdoc-syntax">(</span><span class="jsdoc-keyword">typeof </span><span class="jsdoc-var">c.dataIndex </span><span class="jsdoc-syntax">== </span><span class="jsdoc-string">&quot;undefined&quot;</span><span class="jsdoc-syntax">){
+            </span><span class="jsdoc-var">c.dataIndex </span><span class="jsdoc-syntax">= </span><span class="jsdoc-var">i</span><span class="jsdoc-syntax">;
+        }
+        </span><span class="jsdoc-keyword">if</span><span class="jsdoc-syntax">(</span><span class="jsdoc-keyword">typeof </span><span class="jsdoc-var">c.renderer </span><span class="jsdoc-syntax">== </span><span class="jsdoc-string">&quot;string&quot;</span><span class="jsdoc-syntax">){
+            </span><span class="jsdoc-var">c.renderer </span><span class="jsdoc-syntax">= </span><span class="jsdoc-var">Roo.util.Format</span><span class="jsdoc-syntax">[</span><span class="jsdoc-var">c.renderer</span><span class="jsdoc-syntax">];
+        }
+        </span><span class="jsdoc-keyword">if</span><span class="jsdoc-syntax">(</span><span class="jsdoc-keyword">typeof </span><span class="jsdoc-var">c.id </span><span class="jsdoc-syntax">== </span><span class="jsdoc-string">&quot;undefined&quot;</span><span class="jsdoc-syntax">){
+            </span><span class="jsdoc-var">c.id </span><span class="jsdoc-syntax">= </span><span class="jsdoc-var">Roo.id</span><span class="jsdoc-syntax">();
+        }
+        </span><span class="jsdoc-keyword">if</span><span class="jsdoc-syntax">(</span><span class="jsdoc-var">c.editor </span><span class="jsdoc-syntax">&amp;&amp; </span><span class="jsdoc-var">c.editor.xtype</span><span class="jsdoc-syntax">){
+            </span><span class="jsdoc-var">c.editor  </span><span class="jsdoc-syntax">= </span><span class="jsdoc-var">Roo.factory</span><span class="jsdoc-syntax">(</span><span class="jsdoc-var">c.editor</span><span class="jsdoc-syntax">, </span><span class="jsdoc-var">Roo.grid</span><span class="jsdoc-syntax">);
+        }
+        </span><span class="jsdoc-keyword">if</span><span class="jsdoc-syntax">(</span><span class="jsdoc-var">c.editor </span><span class="jsdoc-syntax">&amp;&amp; </span><span class="jsdoc-var">c.editor.isFormField</span><span class="jsdoc-syntax">){
+            </span><span class="jsdoc-var">c.editor </span><span class="jsdoc-syntax">= </span><span class="jsdoc-keyword">new </span><span class="jsdoc-var">Roo.grid.GridEditor</span><span class="jsdoc-syntax">(</span><span class="jsdoc-var">c.editor</span><span class="jsdoc-syntax">);
+        }
+        </span><span class="jsdoc-var">this.lookup</span><span class="jsdoc-syntax">[</span><span class="jsdoc-var">c.id</span><span class="jsdoc-syntax">] = </span><span class="jsdoc-var">c</span><span class="jsdoc-syntax">;
     }
+
 });
 
 </span><span class="jsdoc-var">Roo.grid.ColumnModel.defaultRenderer </span><span class="jsdoc-syntax">= </span><span class="jsdoc-keyword">function</span><span class="jsdoc-syntax">(</span><span class="jsdoc-var">value</span><span class="jsdoc-syntax">)
diff --git a/docs/src/Roo_svg_Canvas.js.html b/docs/src/Roo_svg_Canvas.js.html
new file mode 100644 (file)
index 0000000..f897923
--- /dev/null
@@ -0,0 +1,104 @@
+<html><head><title>Roo/svg/Canvas.js</title><link rel="stylesheet" type="text/css" href="../../css/highlight-js.css"/></head><body class="highlightpage"><code class="jsdoc-pretty"><span class="jsdoc-comment">/**
+ *
+ * The SVG element.. - with a 'g' subelement, that can handle moving / panning etc..
+ *
+ *
+ * The SVG element is the only element that handles events
+ *   if you click on it, it will look for  roo-svg-observable in the event handler and pass on events to children.
+ *
+ *   
+ * 
+ *
+ */
+
+</span><span class="jsdoc-var">Roo.namespace</span><span class="jsdoc-syntax">(</span><span class="jsdoc-string">'Roo.svg'</span><span class="jsdoc-syntax">);
+
+</span><span class="jsdoc-var">Roo.svg.Canvas </span><span class="jsdoc-syntax">= </span><span class="jsdoc-keyword">function</span><span class="jsdoc-syntax">(</span><span class="jsdoc-var">cfg</span><span class="jsdoc-syntax">)
+{
+    </span><span class="jsdoc-var">Roo.svg.Canvas.superclass.constructor.call</span><span class="jsdoc-syntax">(</span><span class="jsdoc-var">this</span><span class="jsdoc-syntax">, </span><span class="jsdoc-var">cfg</span><span class="jsdoc-syntax">);
+    </span><span class="jsdoc-var">this.addEvents</span><span class="jsdoc-syntax">({
+        </span><span class="jsdoc-string">'click' </span><span class="jsdoc-syntax">: </span><span class="jsdoc-keyword">true</span><span class="jsdoc-syntax">,
+        </span><span class="jsdoc-string">'dblclick' </span><span class="jsdoc-syntax">: </span><span class="jsdoc-keyword">true</span><span class="jsdoc-syntax">,
+        </span><span class="jsdoc-string">'context' </span><span class="jsdoc-syntax">: </span><span class="jsdoc-keyword">true
+    </span><span class="jsdoc-syntax">});
+
+}
+
+</span><span class="jsdoc-var">Roo.extend</span><span class="jsdoc-syntax">(</span><span class="jsdoc-var">Roo.svg.Canvas</span><span class="jsdoc-syntax">, </span><span class="jsdoc-var">Roo.bootstrap.Component</span><span class="jsdoc-syntax">,  {
+
+
+
+    </span><span class="jsdoc-var">getAutoCreate </span><span class="jsdoc-syntax">: </span><span class="jsdoc-keyword">function</span><span class="jsdoc-syntax">(){
+
+
+        </span><span class="jsdoc-keyword">return </span><span class="jsdoc-syntax">{
+            </span><span class="jsdoc-var">ns</span><span class="jsdoc-syntax">: </span><span class="jsdoc-string">&quot;svg&quot;</span><span class="jsdoc-syntax">,
+            </span><span class="jsdoc-var">xmlns</span><span class="jsdoc-syntax">: </span><span class="jsdoc-string">&quot;http://www.w3.org/2000/svg&quot;</span><span class="jsdoc-syntax">,
+            </span><span class="jsdoc-var">tag</span><span class="jsdoc-syntax">: </span><span class="jsdoc-string">&quot;svg&quot;</span><span class="jsdoc-syntax">,
+            </span><span class="jsdoc-var">width</span><span class="jsdoc-syntax">: 100,
+            </span><span class="jsdoc-var">height</span><span class="jsdoc-syntax">: 100,
+            </span><span class="jsdoc-var">cn </span><span class="jsdoc-syntax">: [
+                {
+                    </span><span class="jsdoc-var">ns</span><span class="jsdoc-syntax">: </span><span class="jsdoc-string">&quot;svg&quot;</span><span class="jsdoc-syntax">,
+                    </span><span class="jsdoc-var">tag</span><span class="jsdoc-syntax">: </span><span class="jsdoc-string">&quot;g&quot;</span><span class="jsdoc-syntax">,
+                    </span><span class="jsdoc-var">focusable </span><span class="jsdoc-syntax">: </span><span class="jsdoc-string">'true'
+                </span><span class="jsdoc-syntax">}
+            ]
+        };
+    },
+
+    </span><span class="jsdoc-var">initEvents</span><span class="jsdoc-syntax">: </span><span class="jsdoc-keyword">function</span><span class="jsdoc-syntax">()
+    {
+        </span><span class="jsdoc-var">Roo.svg.Canvas.superclass.initEvents.call</span><span class="jsdoc-syntax">(</span><span class="jsdoc-var">this</span><span class="jsdoc-syntax">);
+        </span><span class="jsdoc-comment">// others...
+
+        </span><span class="jsdoc-var">this.el.on</span><span class="jsdoc-syntax">(</span><span class="jsdoc-string">'click'</span><span class="jsdoc-syntax">, </span><span class="jsdoc-var">this.relayEvent</span><span class="jsdoc-syntax">, </span><span class="jsdoc-var">this</span><span class="jsdoc-syntax">);
+        </span><span class="jsdoc-var">this.el.on</span><span class="jsdoc-syntax">(</span><span class="jsdoc-string">'dblclick'</span><span class="jsdoc-syntax">, </span><span class="jsdoc-var">this.relayEvent</span><span class="jsdoc-syntax">, </span><span class="jsdoc-var">this</span><span class="jsdoc-syntax">);
+        </span><span class="jsdoc-var">this.el.on</span><span class="jsdoc-syntax">(</span><span class="jsdoc-string">'context'</span><span class="jsdoc-syntax">, </span><span class="jsdoc-var">this.relayEvent</span><span class="jsdoc-syntax">, </span><span class="jsdoc-var">this</span><span class="jsdoc-syntax">); </span><span class="jsdoc-comment">// ??? any others
+        </span><span class="jsdoc-var">this.g </span><span class="jsdoc-syntax">= </span><span class="jsdoc-var">this.el.select</span><span class="jsdoc-syntax">(</span><span class="jsdoc-string">'g'</span><span class="jsdoc-syntax">, </span><span class="jsdoc-keyword">true</span><span class="jsdoc-syntax">)</span><span class="jsdoc-var">.first</span><span class="jsdoc-syntax">();
+
+
+    },
+
+    </span><span class="jsdoc-var">relayEvent</span><span class="jsdoc-syntax">: </span><span class="jsdoc-keyword">function</span><span class="jsdoc-syntax">(</span><span class="jsdoc-var">e</span><span class="jsdoc-syntax">)
+    {
+        </span><span class="jsdoc-comment">//e.type
+        </span><span class="jsdoc-keyword">var </span><span class="jsdoc-var">cel </span><span class="jsdoc-syntax">= </span><span class="jsdoc-var">e.getTarget</span><span class="jsdoc-syntax">(</span><span class="jsdoc-string">'.roo-svg-observable'</span><span class="jsdoc-syntax">, </span><span class="jsdoc-keyword">false</span><span class="jsdoc-syntax">, </span><span class="jsdoc-keyword">true</span><span class="jsdoc-syntax">);
+        </span><span class="jsdoc-keyword">if </span><span class="jsdoc-syntax">(!</span><span class="jsdoc-var">cel </span><span class="jsdoc-syntax">|| </span><span class="jsdoc-keyword">typeof</span><span class="jsdoc-syntax">(</span><span class="jsdoc-var">cel.listeners</span><span class="jsdoc-syntax">[</span><span class="jsdoc-var">e.type</span><span class="jsdoc-syntax">]) == </span><span class="jsdoc-string">'undefined'</span><span class="jsdoc-syntax">) {
+            </span><span class="jsdoc-var">this.fireEvent</span><span class="jsdoc-syntax">(</span><span class="jsdoc-var">e.type</span><span class="jsdoc-syntax">);
+            </span><span class="jsdoc-keyword">return</span><span class="jsdoc-syntax">;
+        }
+        </span><span class="jsdoc-var">cel.listeners</span><span class="jsdoc-syntax">[</span><span class="jsdoc-var">e.type</span><span class="jsdoc-syntax">]</span><span class="jsdoc-var">.fire</span><span class="jsdoc-syntax">(</span><span class="jsdoc-var">e</span><span class="jsdoc-syntax">, </span><span class="jsdoc-var">cel</span><span class="jsdoc-syntax">);
+
+    },
+
+
+    </span><span class="jsdoc-var">fitToParent </span><span class="jsdoc-syntax">: </span><span class="jsdoc-keyword">function</span><span class="jsdoc-syntax">()
+    {
+        </span><span class="jsdoc-comment">// should it fit Horizontal - as per this?
+        // or fit full ? // in which case pan/zoom done by drag?
+
+        </span><span class="jsdoc-keyword">if </span><span class="jsdoc-syntax">(!</span><span class="jsdoc-var">this.el.dom.parentNode</span><span class="jsdoc-syntax">) { </span><span class="jsdoc-comment">// check if this Element still exists
+            </span><span class="jsdoc-keyword">return</span><span class="jsdoc-syntax">;
+        }
+        (</span><span class="jsdoc-keyword">function</span><span class="jsdoc-syntax">() {
+            </span><span class="jsdoc-keyword">var </span><span class="jsdoc-var">p </span><span class="jsdoc-syntax">= </span><span class="jsdoc-var">Roo.get</span><span class="jsdoc-syntax">(</span><span class="jsdoc-var">this.el.dom.parentNode</span><span class="jsdoc-syntax">);
+            </span><span class="jsdoc-keyword">var </span><span class="jsdoc-var">gs </span><span class="jsdoc-syntax">= </span><span class="jsdoc-var">this.g.dom.getBBox</span><span class="jsdoc-syntax">();
+            </span><span class="jsdoc-keyword">var </span><span class="jsdoc-var">ratio </span><span class="jsdoc-syntax">= </span><span class="jsdoc-var">gs.height </span><span class="jsdoc-syntax">/ </span><span class="jsdoc-var">gs.width</span><span class="jsdoc-syntax">;
+            </span><span class="jsdoc-var">ratio </span><span class="jsdoc-syntax">= </span><span class="jsdoc-var">isNaN</span><span class="jsdoc-syntax">(</span><span class="jsdoc-var">ratio</span><span class="jsdoc-syntax">) || </span><span class="jsdoc-var">ratio </span><span class="jsdoc-syntax">&lt; 0.2 ? 1 : </span><span class="jsdoc-var">ratio</span><span class="jsdoc-syntax">;
+            </span><span class="jsdoc-keyword">var </span><span class="jsdoc-var">x </span><span class="jsdoc-syntax">= </span><span class="jsdoc-var">p.getComputedWidth</span><span class="jsdoc-syntax">()  - </span><span class="jsdoc-var">p.getFrameWidth</span><span class="jsdoc-syntax">(</span><span class="jsdoc-string">'lr'</span><span class="jsdoc-syntax">) - 20; </span><span class="jsdoc-comment">// close as possible with scroll bar
+            </span><span class="jsdoc-var">this.el.attr</span><span class="jsdoc-syntax">({
+                </span><span class="jsdoc-var">width </span><span class="jsdoc-syntax">: </span><span class="jsdoc-var">x</span><span class="jsdoc-syntax">,
+                </span><span class="jsdoc-var">height </span><span class="jsdoc-syntax">: </span><span class="jsdoc-var">x </span><span class="jsdoc-syntax">* </span><span class="jsdoc-var">ratio </span><span class="jsdoc-comment">//p.getComputedHeight() - p.getFrameWidth('tb')
+            </span><span class="jsdoc-syntax">});
+            </span><span class="jsdoc-keyword">if </span><span class="jsdoc-syntax">(</span><span class="jsdoc-var">gs.height</span><span class="jsdoc-syntax">) {
+                </span><span class="jsdoc-var">this.el.attr</span><span class="jsdoc-syntax">(</span><span class="jsdoc-string">&quot;viewBox&quot;</span><span class="jsdoc-syntax">, </span><span class="jsdoc-var">gs.x </span><span class="jsdoc-syntax">+ </span><span class="jsdoc-string">&quot; &quot; </span><span class="jsdoc-syntax">+ </span><span class="jsdoc-var">gs.y </span><span class="jsdoc-syntax">+ </span><span class="jsdoc-string">&quot; &quot; </span><span class="jsdoc-syntax">+ </span><span class="jsdoc-var">gs.width </span><span class="jsdoc-syntax">+ </span><span class="jsdoc-string">&quot; &quot; </span><span class="jsdoc-syntax">+ </span><span class="jsdoc-var">gs.height</span><span class="jsdoc-syntax">);
+            }
+
+        })</span><span class="jsdoc-var">.defer</span><span class="jsdoc-syntax">(300, </span><span class="jsdoc-var">this</span><span class="jsdoc-syntax">);
+
+    }
+
+
+
+});</span></code></body></html>
\ No newline at end of file
diff --git a/docs/src/Roo_svg_Element.js.html b/docs/src/Roo_svg_Element.js.html
new file mode 100644 (file)
index 0000000..650ab9b
--- /dev/null
@@ -0,0 +1,116 @@
+<html><head><title>Roo/svg/Element.js</title><link rel="stylesheet" type="text/css" href="../../css/highlight-js.css"/></head><body class="highlightpage"><code class="jsdoc-pretty"><span class="jsdoc-comment">/**
+ *
+ * The SVG element.. - with a 'g' subelement, that can handle moving / panning etc..
+ *
+ *
+ * The SVG element is the only element that handles events
+ *   if you click on it, it will look for  roo-svg-observable in the event handler and pass on events to children.
+ *
+ *    
+ *
+ */
+
+</span><span class="jsdoc-var">Roo.namespace</span><span class="jsdoc-syntax">(</span><span class="jsdoc-string">'Roo.svg'</span><span class="jsdoc-syntax">);
+
+</span><span class="jsdoc-var">Roo.svg.Element </span><span class="jsdoc-syntax">= </span><span class="jsdoc-keyword">function</span><span class="jsdoc-syntax">(</span><span class="jsdoc-var">cfg</span><span class="jsdoc-syntax">)
+{
+    </span><span class="jsdoc-var">Roo.svg.Element.superclass.constructor.call</span><span class="jsdoc-syntax">(</span><span class="jsdoc-var">this</span><span class="jsdoc-syntax">, </span><span class="jsdoc-var">cfg</span><span class="jsdoc-syntax">);
+    </span><span class="jsdoc-var">this.addEvents</span><span class="jsdoc-syntax">({
+        </span><span class="jsdoc-string">'click' </span><span class="jsdoc-syntax">: </span><span class="jsdoc-keyword">true</span><span class="jsdoc-syntax">,
+        </span><span class="jsdoc-string">'dblclick' </span><span class="jsdoc-syntax">: </span><span class="jsdoc-keyword">true</span><span class="jsdoc-syntax">,
+        </span><span class="jsdoc-string">'context' </span><span class="jsdoc-syntax">: </span><span class="jsdoc-keyword">true
+    </span><span class="jsdoc-syntax">});
+
+}
+
+</span><span class="jsdoc-var">Roo.extend</span><span class="jsdoc-syntax">(</span><span class="jsdoc-var">Roo.svg.Element</span><span class="jsdoc-syntax">, </span><span class="jsdoc-var">Roo.Component</span><span class="jsdoc-syntax">,  {
+
+    </span><span class="jsdoc-var">tag </span><span class="jsdoc-syntax">: </span><span class="jsdoc-string">'g'</span><span class="jsdoc-syntax">,
+
+    </span><span class="jsdoc-var">cls </span><span class="jsdoc-syntax">: </span><span class="jsdoc-string">''</span><span class="jsdoc-syntax">,
+
+    </span><span class="jsdoc-var">getAutoCreate </span><span class="jsdoc-syntax">: </span><span class="jsdoc-keyword">function</span><span class="jsdoc-syntax">(){
+
+
+        </span><span class="jsdoc-keyword">return </span><span class="jsdoc-syntax">{
+            </span><span class="jsdoc-var">ns</span><span class="jsdoc-syntax">: </span><span class="jsdoc-string">&quot;svg&quot;</span><span class="jsdoc-syntax">,
+            </span><span class="jsdoc-var">xmlns</span><span class="jsdoc-syntax">: </span><span class="jsdoc-string">&quot;http://www.w3.org/2000/svg&quot;</span><span class="jsdoc-syntax">,
+            </span><span class="jsdoc-var">tag</span><span class="jsdoc-syntax">: </span><span class="jsdoc-var">this.tag</span><span class="jsdoc-syntax">,
+            </span><span class="jsdoc-var">cls </span><span class="jsdoc-syntax">: </span><span class="jsdoc-var">this.cls </span><span class="jsdoc-syntax">+ </span><span class="jsdoc-string">' roo-svg-observable'
+        </span><span class="jsdoc-syntax">};
+    },
+
+    </span><span class="jsdoc-var">initEvents</span><span class="jsdoc-syntax">: </span><span class="jsdoc-keyword">function</span><span class="jsdoc-syntax">()
+    {
+        </span><span class="jsdoc-var">Roo.svg.Canvas.superclass.initEvents.call</span><span class="jsdoc-syntax">(</span><span class="jsdoc-var">this</span><span class="jsdoc-syntax">);
+        </span><span class="jsdoc-comment">// others...
+        </span><span class="jsdoc-var">this.el.relayEvent</span><span class="jsdoc-syntax">(</span><span class="jsdoc-string">'click'</span><span class="jsdoc-syntax">, </span><span class="jsdoc-var">this</span><span class="jsdoc-syntax">);
+        </span><span class="jsdoc-var">this.el.relayEvent</span><span class="jsdoc-syntax">(</span><span class="jsdoc-string">'dblclick'</span><span class="jsdoc-syntax">, </span><span class="jsdoc-var">this</span><span class="jsdoc-syntax">);
+        </span><span class="jsdoc-var">this.el.relayEvent</span><span class="jsdoc-syntax">(</span><span class="jsdoc-string">'context'</span><span class="jsdoc-syntax">, </span><span class="jsdoc-var">this</span><span class="jsdoc-syntax">);
+
+    },
+
+     </span><span class="jsdoc-comment">// private
+    </span><span class="jsdoc-var">onRender </span><span class="jsdoc-syntax">: </span><span class="jsdoc-keyword">function</span><span class="jsdoc-syntax">(</span><span class="jsdoc-var">ct</span><span class="jsdoc-syntax">, </span><span class="jsdoc-var">position</span><span class="jsdoc-syntax">)
+    {
+       </span><span class="jsdoc-comment">// Roo.log(&quot;Call onRender: &quot; + this.xtype);
+
+        </span><span class="jsdoc-var">Roo.bootstrap.Component.superclass.onRender.call</span><span class="jsdoc-syntax">(</span><span class="jsdoc-var">this</span><span class="jsdoc-syntax">, </span><span class="jsdoc-var">ct</span><span class="jsdoc-syntax">, </span><span class="jsdoc-var">position</span><span class="jsdoc-syntax">);
+
+        </span><span class="jsdoc-keyword">if</span><span class="jsdoc-syntax">(</span><span class="jsdoc-var">this.el</span><span class="jsdoc-syntax">){
+            </span><span class="jsdoc-keyword">if </span><span class="jsdoc-syntax">(</span><span class="jsdoc-var">this.el.attr</span><span class="jsdoc-syntax">(</span><span class="jsdoc-string">'xtype'</span><span class="jsdoc-syntax">)) {
+                </span><span class="jsdoc-var">this.el.attr</span><span class="jsdoc-syntax">(</span><span class="jsdoc-string">'xtypex'</span><span class="jsdoc-syntax">, </span><span class="jsdoc-var">this.el.attr</span><span class="jsdoc-syntax">(</span><span class="jsdoc-string">'xtype'</span><span class="jsdoc-syntax">));
+                </span><span class="jsdoc-var">this.el.dom.removeAttribute</span><span class="jsdoc-syntax">(</span><span class="jsdoc-string">'xtype'</span><span class="jsdoc-syntax">);
+
+                </span><span class="jsdoc-var">this.initEvents</span><span class="jsdoc-syntax">();
+            }
+
+            </span><span class="jsdoc-keyword">return</span><span class="jsdoc-syntax">;
+        }
+
+
+
+        </span><span class="jsdoc-keyword">var </span><span class="jsdoc-var">cfg </span><span class="jsdoc-syntax">= </span><span class="jsdoc-var">Roo.apply</span><span class="jsdoc-syntax">({},  </span><span class="jsdoc-var">this.getAutoCreate</span><span class="jsdoc-syntax">());
+
+        </span><span class="jsdoc-var">cfg.id </span><span class="jsdoc-syntax">= </span><span class="jsdoc-var">this.id </span><span class="jsdoc-syntax">|| </span><span class="jsdoc-var">Roo.id</span><span class="jsdoc-syntax">();
+
+        </span><span class="jsdoc-comment">// fill in the extra attributes 
+        </span><span class="jsdoc-keyword">if </span><span class="jsdoc-syntax">(</span><span class="jsdoc-var">this.xattr </span><span class="jsdoc-syntax">&amp;&amp; </span><span class="jsdoc-keyword">typeof</span><span class="jsdoc-syntax">(</span><span class="jsdoc-var">this.xattr</span><span class="jsdoc-syntax">) ==</span><span class="jsdoc-string">'object'</span><span class="jsdoc-syntax">) {
+            </span><span class="jsdoc-keyword">for </span><span class="jsdoc-syntax">(</span><span class="jsdoc-keyword">var </span><span class="jsdoc-var">i </span><span class="jsdoc-keyword">in </span><span class="jsdoc-var">this.xattr</span><span class="jsdoc-syntax">) {
+                </span><span class="jsdoc-var">cfg</span><span class="jsdoc-syntax">[</span><span class="jsdoc-var">i</span><span class="jsdoc-syntax">] = </span><span class="jsdoc-var">this.xattr</span><span class="jsdoc-syntax">[</span><span class="jsdoc-var">i</span><span class="jsdoc-syntax">];
+            }
+        }
+
+        </span><span class="jsdoc-keyword">if</span><span class="jsdoc-syntax">(</span><span class="jsdoc-var">this.dataId</span><span class="jsdoc-syntax">){
+            </span><span class="jsdoc-var">cfg.dataId </span><span class="jsdoc-syntax">= </span><span class="jsdoc-var">this.dataId</span><span class="jsdoc-syntax">;
+        }
+
+        </span><span class="jsdoc-keyword">if </span><span class="jsdoc-syntax">(</span><span class="jsdoc-var">this.cls</span><span class="jsdoc-syntax">) {
+            </span><span class="jsdoc-var">cfg.cls </span><span class="jsdoc-syntax">= (</span><span class="jsdoc-keyword">typeof</span><span class="jsdoc-syntax">(</span><span class="jsdoc-var">cfg.cls</span><span class="jsdoc-syntax">) == </span><span class="jsdoc-string">'undefined'</span><span class="jsdoc-syntax">) ? </span><span class="jsdoc-var">this.cls </span><span class="jsdoc-syntax">: </span><span class="jsdoc-var">cfg.cls </span><span class="jsdoc-syntax">+ </span><span class="jsdoc-string">' ' </span><span class="jsdoc-syntax">+ </span><span class="jsdoc-var">this.cls</span><span class="jsdoc-syntax">;
+        }
+
+        </span><span class="jsdoc-keyword">if </span><span class="jsdoc-syntax">(</span><span class="jsdoc-var">this.style</span><span class="jsdoc-syntax">) { </span><span class="jsdoc-comment">// fixme needs to support more complex style data.
+            </span><span class="jsdoc-var">cfg.style </span><span class="jsdoc-syntax">= </span><span class="jsdoc-var">this.style</span><span class="jsdoc-syntax">;
+        }
+
+        </span><span class="jsdoc-keyword">if</span><span class="jsdoc-syntax">(</span><span class="jsdoc-var">this.name</span><span class="jsdoc-syntax">){
+            </span><span class="jsdoc-var">cfg.name </span><span class="jsdoc-syntax">= </span><span class="jsdoc-var">this.name</span><span class="jsdoc-syntax">;
+        }
+
+        </span><span class="jsdoc-var">this.el </span><span class="jsdoc-syntax">= </span><span class="jsdoc-var">ct.createChild</span><span class="jsdoc-syntax">(</span><span class="jsdoc-var">cfg</span><span class="jsdoc-syntax">, </span><span class="jsdoc-var">position</span><span class="jsdoc-syntax">);
+
+        </span><span class="jsdoc-keyword">if </span><span class="jsdoc-syntax">(</span><span class="jsdoc-var">this.tooltip</span><span class="jsdoc-syntax">) {
+            </span><span class="jsdoc-var">this.tooltipEl</span><span class="jsdoc-syntax">()</span><span class="jsdoc-var">.attr</span><span class="jsdoc-syntax">(</span><span class="jsdoc-string">'tooltip'</span><span class="jsdoc-syntax">, </span><span class="jsdoc-var">this.tooltip</span><span class="jsdoc-syntax">);
+        }
+
+        </span><span class="jsdoc-keyword">if</span><span class="jsdoc-syntax">(</span><span class="jsdoc-var">this.tabIndex </span><span class="jsdoc-syntax">!== </span><span class="jsdoc-var">undefined</span><span class="jsdoc-syntax">){
+            </span><span class="jsdoc-var">this.el.dom.setAttribute</span><span class="jsdoc-syntax">(</span><span class="jsdoc-string">'tabIndex'</span><span class="jsdoc-syntax">, </span><span class="jsdoc-var">this.tabIndex</span><span class="jsdoc-syntax">);
+        }
+
+        </span><span class="jsdoc-var">this.initEvents</span><span class="jsdoc-syntax">();
+
+    }
+
+
+
+});</span></code></body></html>
\ No newline at end of file
index 8a469c3..544db99 100644 (file)
         }
       ]
     },
+    {
+      "name" : "addColumn",
+      "desc" : "Add a column (experimental...) - defaults to adding to the end..",
+      "isStatic" : false,
+      "isConstructor" : false,
+      "isPrivate" : false,
+      "memberOf" : "Roo.grid.ColumnModel",
+      "example" : "",
+      "deprecated" : "",
+      "since" : "",
+      "see" : "",
+      "params" : [
+        {
+          "name" : "config",
+          "type" : "Object",
+          "desc" : "",
+          "isOptional" : false
+        }
+      ],
+      "returns" : []
+    },
     {
       "name" : "getColumnHeader",
       "desc" : "Returns the header for the specified column.",
index 4c5c71b..b3f20f6 100644 (file)
       ],
       "returns" : []
     },
-    {
-      "name" : "namespace",
-      "desc" : "Creates namespaces to be used for scoping variables and classes so that they are not global.  Usage:\n<pre><code>\nRoo.namespace('Company', 'Company.data');\nCompany.Widget = function() { ... }\nCompany.data.CustomStore = function(config) { ... }\n</code></pre>",
-      "isStatic" : true,
-      "isConstructor" : false,
-      "isPrivate" : false,
-      "memberOf" : "Roo",
-      "example" : "",
-      "deprecated" : "",
-      "since" : "",
-      "see" : "",
-      "params" : [
-        {
-          "name" : "namespace1",
-          "type" : "String",
-          "desc" : "",
-          "isOptional" : false
-        },
-        {
-          "name" : "namespace2",
-          "type" : "String",
-          "desc" : "",
-          "isOptional" : false
-        },
-        {
-          "name" : "etc",
-          "type" : "String",
-          "desc" : "",
-          "isOptional" : false
-        }
-      ],
-      "returns" : []
-    },
     {
       "name" : "override",
       "desc" : "Adds a list of functions to the prototype of an existing class, overwriting any existing methods with the same name.\nUsage:<pre><code>\nRoo.override(MyClass, {\n    newMethod1: function(){\n        // etc.\n    },\n    newMethod2: function(foo){\n        // etc.\n    }\n});\n </code></pre>",
index 47a0b4a..87c9b8b 100644 (file)
@@ -2469,8 +2469,7 @@ var sm=this.grid.selModel;if(sm.getSelectedCell){if(!sm.getSelectedCell()){retur
 }Roo.log("getDragData");return {grid:this.grid,ddel:this.ddel,rowIndex:A,selections:sm.getSelections?sm.getSelections():(sm.getSelectedCell()?[this.grid.ds.getAt(sm.getSelectedCell()[0])]:[])};}return false;},onInitDrag:function(e){var A=this.dragData;this.ddel.innerHTML=this.grid.getDragDropText();
 this.proxy.update(this.ddel);},afterRepair:function(){this.dragging=false;},getRepairXY:function(e,A){return false;},onEndDrag:function(A,e){},onValidDrop:function(dd,e,id){this.hideProxy();},beforeInvalidDrop:function(e,id){}});
 // Roo/grid/ColumnModel.js
-Roo.grid.ColumnModel=function(A){this.config=A;this.lookup={};for(var i=0,B=A.length;i<B;i++){var c=A[i];if(typeof c.dataIndex=="undefined"){c.dataIndex=i;}if(typeof c.renderer=="string"){c.renderer=Roo.util.Format[c.renderer];}if(typeof c.id=="undefined"){c.id=Roo.id();
-}if(c.editor&&c.editor.xtype){c.editor=Roo.factory(c.editor,Roo.grid);}if(c.editor&&c.editor.isFormField){c.editor=new Roo.grid.GridEditor(c.editor);}this.lookup[c.id]=c;}this.defaultWidth=100;this.defaultSortable=false;this.addEvents({"widthchange":true,"headerchange":true,"hiddenchange":true,"columnmoved":true,"columnlockchange":true}
+Roo.grid.ColumnModel=function(A){this.config=[];this.lookup={};for(var i=0,B=A.length;i<B;i++){this.addColumn(A[i]);}this.defaultWidth=100;this.defaultSortable=false;this.addEvents({"widthchange":true,"headerchange":true,"hiddenchange":true,"columnmoved":true,"columnlockchange":true}
 );Roo.grid.ColumnModel.superclass.constructor.call(this);};Roo.extend(Roo.grid.ColumnModel,Roo.util.Observable,{getColumnId:function(A){return this.config[A].id;},getColumnById:function(id){return this.lookup[id];},getColumnByDataIndex:function(A){var B=this.findColumnIndex(A);
 return B>-1?this.config[B]:false;},getIndexById:function(id){for(var i=0,A=this.config.length;i<A;i++){if(this.config[i].id==id){return i;}}return -1;},findColumnIndex:function(A){for(var i=0,B=this.config.length;i<B;i++){if(this.config[i].dataIndex==A){return i;
 }}return -1;},moveColumn:function(A,B){var c=this.config[A];this.config.splice(A,1);this.config.splice(B,0,c);this.dataMap=null;this.fireEvent("columnmoved",this,A,B);},isLocked:function(A){return this.config[A].locked===true;},setLocked:function(A,B,C){if(this.isLocked(A)==B){return;
@@ -2482,8 +2481,9 @@ for(var i=0,B=this.config.length;i<B;i++){var c=this.config[i];if(fn.call(A||thi
 },setColumnHeader:function(A,B){this.config[A].header=B;this.fireEvent("headerchange",this,A,B);},getColumnTooltip:function(A){return this.config[A].tooltip;},setColumnTooltip:function(A,B){this.config[A].tooltip=B;},getDataIndex:function(A){return this.config[A].dataIndex;
 },setDataIndex:function(A,B){this.config[A].dataIndex=B;},isCellEditable:function(A,B){return (this.config[A].editable||(typeof this.config[A].editable=="undefined"&&this.config[A].editor))?true:false;},getCellEditor:function(A,B){return this.config[A].editor;
 },setEditable:function(A,B){this.config[A].editable=B;},isHidden:function(A){return this.config[A].hidden;},isFixed:function(A){return this.config[A].fixed;},isResizable:function(A){return A>=0&&this.config[A].resizable!==false&&this.config[A].fixed!==true;
-},setHidden:function(A,B){this.config[A].hidden=B;this.totalWidth=null;this.fireEvent("hiddenchange",this,A,B);},setEditor:function(A,B){this.config[A].editor=B;}});Roo.grid.ColumnModel.defaultRenderer=function(A){if(typeof A=="object"){return A;}if(typeof A=="string"&&A.length<1){return "&#160;";
-}return String.format("{0}",A);};Roo.grid.DefaultColumnModel=Roo.grid.ColumnModel;
+},setHidden:function(A,B){this.config[A].hidden=B;this.totalWidth=null;this.fireEvent("hiddenchange",this,A,B);},setEditor:function(A,B){this.config[A].editor=B;},addColumn:function(c){var i=this.config.length;if(typeof c.dataIndex=="undefined"){c.dataIndex=i;
+}if(typeof c.renderer=="string"){c.renderer=Roo.util.Format[c.renderer];}if(typeof c.id=="undefined"){c.id=Roo.id();}if(c.editor&&c.editor.xtype){c.editor=Roo.factory(c.editor,Roo.grid);}if(c.editor&&c.editor.isFormField){c.editor=new Roo.grid.GridEditor(c.editor);
+}this.lookup[c.id]=c;}});Roo.grid.ColumnModel.defaultRenderer=function(A){if(typeof A=="object"){return A;}if(typeof A=="string"&&A.length<1){return "&#160;";}return String.format("{0}",A);};Roo.grid.DefaultColumnModel=Roo.grid.ColumnModel;
 // Roo/grid/AbstractSelectionModel.js
 Roo.grid.AbstractSelectionModel=function(){this.locked=false;Roo.grid.AbstractSelectionModel.superclass.constructor.call(this);};Roo.extend(Roo.grid.AbstractSelectionModel,Roo.util.Observable,{init:function(A){this.grid=A;this.initEvents();},lock:function(){this.locked=true;
 },unlock:function(){this.locked=false;},isLocked:function(){return this.locked;}});
index 9e4fb24..6e7806c 100644 (file)
@@ -7305,30 +7305,15 @@ Roo.grid.ColumnModel = function(config){
        /**
      * The config passed into the constructor
      */
-    this.config = config;
+    this.config = []; //config;
     this.lookup = {};
 
     // if no id, create one
     // if the column does not have a dataIndex mapping,
     // map it to the order it is in the config
     for(var i = 0, len = config.length; i < len; i++){
-        var c = config[i];
-        if(typeof c.dataIndex == "undefined"){
-            c.dataIndex = i;
-        }
-        if(typeof c.renderer == "string"){
-            c.renderer = Roo.util.Format[c.renderer];
-        }
-        if(typeof c.id == "undefined"){
-            c.id = Roo.id();
-        }
-        if(c.editor && c.editor.xtype){
-            c.editor  = Roo.factory(c.editor, Roo.grid);
-        }
-        if(c.editor && c.editor.isFormField){
-            c.editor = new Roo.grid.GridEditor(c.editor);
-        }
-        this.lookup[c.id] = c;
+       this.addColumn(config[i]);
+       
     }
 
     /**
@@ -7796,7 +7781,33 @@ Roo.extend(Roo.grid.ColumnModel, Roo.util.Observable, {
      */
     setEditor : function(col, editor){
         this.config[col].editor = editor;
+    },
+    /**
+     * Add a column (experimental...) - defaults to adding to the end..
+     * @param {Object} config 
+    */
+    addColumn : function(c)
+    {
+    
+       var i = this.config.length;
+       if(typeof c.dataIndex == "undefined"){
+            c.dataIndex = i;
+        }
+        if(typeof c.renderer == "string"){
+            c.renderer = Roo.util.Format[c.renderer];
+        }
+        if(typeof c.id == "undefined"){
+            c.id = Roo.id();
+        }
+        if(c.editor && c.editor.xtype){
+            c.editor  = Roo.factory(c.editor, Roo.grid);
+        }
+        if(c.editor && c.editor.isFormField){
+            c.editor = new Roo.grid.GridEditor(c.editor);
+        }
+        this.lookup[c.id] = c;
     }
+    
 });
 
 Roo.grid.ColumnModel.defaultRenderer = function(value)
index ee6d637..7dfc3e5 100644 (file)
@@ -304,8 +304,7 @@ Roo.bootstrap.PaginationItem=function(A){Roo.bootstrap.PaginationItem.superclass
 Roo.bootstrap.Slider=function(A){Roo.bootstrap.Slider.superclass.constructor.call(this,A);};Roo.extend(Roo.bootstrap.Slider,Roo.bootstrap.Component,{getAutoCreate:function(){var A={tag:'div',cls:'slider slider-sample1 vertical-handler ui-slider ui-slider-horizontal ui-widget ui-widget-content ui-corner-all',cn:[{tag:'a',cls:'ui-slider-handle ui-state-default ui-corner-all'}
 ]};return A;}});
 // Roo/grid/ColumnModel.js
-Roo.grid.ColumnModel=function(A){this.config=A;this.lookup={};for(var i=0,B=A.length;i<B;i++){var c=A[i];if(typeof c.dataIndex=="undefined"){c.dataIndex=i;}if(typeof c.renderer=="string"){c.renderer=Roo.util.Format[c.renderer];}if(typeof c.id=="undefined"){c.id=Roo.id();
-}if(c.editor&&c.editor.xtype){c.editor=Roo.factory(c.editor,Roo.grid);}if(c.editor&&c.editor.isFormField){c.editor=new Roo.grid.GridEditor(c.editor);}this.lookup[c.id]=c;}this.defaultWidth=100;this.defaultSortable=false;this.addEvents({"widthchange":true,"headerchange":true,"hiddenchange":true,"columnmoved":true,"columnlockchange":true}
+Roo.grid.ColumnModel=function(A){this.config=[];this.lookup={};for(var i=0,B=A.length;i<B;i++){this.addColumn(A[i]);}this.defaultWidth=100;this.defaultSortable=false;this.addEvents({"widthchange":true,"headerchange":true,"hiddenchange":true,"columnmoved":true,"columnlockchange":true}
 );Roo.grid.ColumnModel.superclass.constructor.call(this);};Roo.extend(Roo.grid.ColumnModel,Roo.util.Observable,{getColumnId:function(A){return this.config[A].id;},getColumnById:function(id){return this.lookup[id];},getColumnByDataIndex:function(A){var B=this.findColumnIndex(A);
 return B>-1?this.config[B]:false;},getIndexById:function(id){for(var i=0,A=this.config.length;i<A;i++){if(this.config[i].id==id){return i;}}return -1;},findColumnIndex:function(A){for(var i=0,B=this.config.length;i<B;i++){if(this.config[i].dataIndex==A){return i;
 }}return -1;},moveColumn:function(A,B){var c=this.config[A];this.config.splice(A,1);this.config.splice(B,0,c);this.dataMap=null;this.fireEvent("columnmoved",this,A,B);},isLocked:function(A){return this.config[A].locked===true;},setLocked:function(A,B,C){if(this.isLocked(A)==B){return;
@@ -317,8 +316,9 @@ for(var i=0,B=this.config.length;i<B;i++){var c=this.config[i];if(fn.call(A||thi
 },setColumnHeader:function(A,B){this.config[A].header=B;this.fireEvent("headerchange",this,A,B);},getColumnTooltip:function(A){return this.config[A].tooltip;},setColumnTooltip:function(A,B){this.config[A].tooltip=B;},getDataIndex:function(A){return this.config[A].dataIndex;
 },setDataIndex:function(A,B){this.config[A].dataIndex=B;},isCellEditable:function(A,B){return (this.config[A].editable||(typeof this.config[A].editable=="undefined"&&this.config[A].editor))?true:false;},getCellEditor:function(A,B){return this.config[A].editor;
 },setEditable:function(A,B){this.config[A].editable=B;},isHidden:function(A){return this.config[A].hidden;},isFixed:function(A){return this.config[A].fixed;},isResizable:function(A){return A>=0&&this.config[A].resizable!==false&&this.config[A].fixed!==true;
-},setHidden:function(A,B){this.config[A].hidden=B;this.totalWidth=null;this.fireEvent("hiddenchange",this,A,B);},setEditor:function(A,B){this.config[A].editor=B;}});Roo.grid.ColumnModel.defaultRenderer=function(A){if(typeof A=="object"){return A;}if(typeof A=="string"&&A.length<1){return "&#160;";
-}return String.format("{0}",A);};Roo.grid.DefaultColumnModel=Roo.grid.ColumnModel;
+},setHidden:function(A,B){this.config[A].hidden=B;this.totalWidth=null;this.fireEvent("hiddenchange",this,A,B);},setEditor:function(A,B){this.config[A].editor=B;},addColumn:function(c){var i=this.config.length;if(typeof c.dataIndex=="undefined"){c.dataIndex=i;
+}if(typeof c.renderer=="string"){c.renderer=Roo.util.Format[c.renderer];}if(typeof c.id=="undefined"){c.id=Roo.id();}if(c.editor&&c.editor.xtype){c.editor=Roo.factory(c.editor,Roo.grid);}if(c.editor&&c.editor.isFormField){c.editor=new Roo.grid.GridEditor(c.editor);
+}this.lookup[c.id]=c;}});Roo.grid.ColumnModel.defaultRenderer=function(A){if(typeof A=="object"){return A;}if(typeof A=="string"&&A.length<1){return "&#160;";}return String.format("{0}",A);};Roo.grid.DefaultColumnModel=Roo.grid.ColumnModel;
 // Roo/LoadMask.js
 Roo.LoadMask=function(el,A){this.el=Roo.get(el);Roo.apply(this,A);if(this.store){this.store.on('beforeload',this.onBeforeLoad,this);this.store.on('load',this.onLoad,this);this.store.on('loadexception',this.onLoadException,this);this.removeMask=false;}else{var um=this.el.getUpdateManager();
 um.showLoadIndicator=false;um.on('beforeupdate',this.onBeforeLoad,this);um.on('update',this.onLoad,this);um.on('failure',this.onLoad,this);this.removeMask=true;}};Roo.LoadMask.prototype={msg:'Loading...',msgCls:'x-mask-loading',disabled:false,disable:function(){this.disabled=true;
index 7fafc80..59a70f4 100644 (file)
@@ -58266,30 +58266,15 @@ Roo.grid.ColumnModel = function(config){
        /**
      * The config passed into the constructor
      */
-    this.config = config;
+    this.config = []; //config;
     this.lookup = {};
 
     // if no id, create one
     // if the column does not have a dataIndex mapping,
     // map it to the order it is in the config
     for(var i = 0, len = config.length; i < len; i++){
-        var c = config[i];
-        if(typeof c.dataIndex == "undefined"){
-            c.dataIndex = i;
-        }
-        if(typeof c.renderer == "string"){
-            c.renderer = Roo.util.Format[c.renderer];
-        }
-        if(typeof c.id == "undefined"){
-            c.id = Roo.id();
-        }
-        if(c.editor && c.editor.xtype){
-            c.editor  = Roo.factory(c.editor, Roo.grid);
-        }
-        if(c.editor && c.editor.isFormField){
-            c.editor = new Roo.grid.GridEditor(c.editor);
-        }
-        this.lookup[c.id] = c;
+       this.addColumn(config[i]);
+       
     }
 
     /**
@@ -58757,7 +58742,33 @@ Roo.extend(Roo.grid.ColumnModel, Roo.util.Observable, {
      */
     setEditor : function(col, editor){
         this.config[col].editor = editor;
+    },
+    /**
+     * Add a column (experimental...) - defaults to adding to the end..
+     * @param {Object} config 
+    */
+    addColumn : function(c)
+    {
+    
+       var i = this.config.length;
+       if(typeof c.dataIndex == "undefined"){
+            c.dataIndex = i;
+        }
+        if(typeof c.renderer == "string"){
+            c.renderer = Roo.util.Format[c.renderer];
+        }
+        if(typeof c.id == "undefined"){
+            c.id = Roo.id();
+        }
+        if(c.editor && c.editor.xtype){
+            c.editor  = Roo.factory(c.editor, Roo.grid);
+        }
+        if(c.editor && c.editor.isFormField){
+            c.editor = new Roo.grid.GridEditor(c.editor);
+        }
+        this.lookup[c.id] = c;
     }
+    
 });
 
 Roo.grid.ColumnModel.defaultRenderer = function(value)
index 9709744..91439dc 100644 (file)
@@ -35127,30 +35127,15 @@ Roo.grid.ColumnModel = function(config){
        /**
      * The config passed into the constructor
      */
-    this.config = config;
+    this.config = []; //config;
     this.lookup = {};
 
     // if no id, create one
     // if the column does not have a dataIndex mapping,
     // map it to the order it is in the config
     for(var i = 0, len = config.length; i < len; i++){
-        var c = config[i];
-        if(typeof c.dataIndex == "undefined"){
-            c.dataIndex = i;
-        }
-        if(typeof c.renderer == "string"){
-            c.renderer = Roo.util.Format[c.renderer];
-        }
-        if(typeof c.id == "undefined"){
-            c.id = Roo.id();
-        }
-        if(c.editor && c.editor.xtype){
-            c.editor  = Roo.factory(c.editor, Roo.grid);
-        }
-        if(c.editor && c.editor.isFormField){
-            c.editor = new Roo.grid.GridEditor(c.editor);
-        }
-        this.lookup[c.id] = c;
+       this.addColumn(config[i]);
+       
     }
 
     /**
@@ -35618,7 +35603,33 @@ Roo.extend(Roo.grid.ColumnModel, Roo.util.Observable, {
      */
     setEditor : function(col, editor){
         this.config[col].editor = editor;
+    },
+    /**
+     * Add a column (experimental...) - defaults to adding to the end..
+     * @param {Object} config 
+    */
+    addColumn : function(c)
+    {
+    
+       var i = this.config.length;
+       if(typeof c.dataIndex == "undefined"){
+            c.dataIndex = i;
+        }
+        if(typeof c.renderer == "string"){
+            c.renderer = Roo.util.Format[c.renderer];
+        }
+        if(typeof c.id == "undefined"){
+            c.id = Roo.id();
+        }
+        if(c.editor && c.editor.xtype){
+            c.editor  = Roo.factory(c.editor, Roo.grid);
+        }
+        if(c.editor && c.editor.isFormField){
+            c.editor = new Roo.grid.GridEditor(c.editor);
+        }
+        this.lookup[c.id] = c;
     }
+    
 });
 
 Roo.grid.ColumnModel.defaultRenderer = function(value)
index 668c182..fc1df66 100644 (file)
@@ -1567,8 +1567,7 @@ var sm=this.grid.selModel;if(sm.getSelectedCell){if(!sm.getSelectedCell()){retur
 }Roo.log("getDragData");return {grid:this.grid,ddel:this.ddel,rowIndex:A,selections:sm.getSelections?sm.getSelections():(sm.getSelectedCell()?[this.grid.ds.getAt(sm.getSelectedCell()[0])]:[])};}return false;},onInitDrag:function(e){var A=this.dragData;this.ddel.innerHTML=this.grid.getDragDropText();
 this.proxy.update(this.ddel);},afterRepair:function(){this.dragging=false;},getRepairXY:function(e,A){return false;},onEndDrag:function(A,e){},onValidDrop:function(dd,e,id){this.hideProxy();},beforeInvalidDrop:function(e,id){}});
 // Roo/grid/ColumnModel.js
-Roo.grid.ColumnModel=function(A){this.config=A;this.lookup={};for(var i=0,B=A.length;i<B;i++){var c=A[i];if(typeof c.dataIndex=="undefined"){c.dataIndex=i;}if(typeof c.renderer=="string"){c.renderer=Roo.util.Format[c.renderer];}if(typeof c.id=="undefined"){c.id=Roo.id();
-}if(c.editor&&c.editor.xtype){c.editor=Roo.factory(c.editor,Roo.grid);}if(c.editor&&c.editor.isFormField){c.editor=new Roo.grid.GridEditor(c.editor);}this.lookup[c.id]=c;}this.defaultWidth=100;this.defaultSortable=false;this.addEvents({"widthchange":true,"headerchange":true,"hiddenchange":true,"columnmoved":true,"columnlockchange":true}
+Roo.grid.ColumnModel=function(A){this.config=[];this.lookup={};for(var i=0,B=A.length;i<B;i++){this.addColumn(A[i]);}this.defaultWidth=100;this.defaultSortable=false;this.addEvents({"widthchange":true,"headerchange":true,"hiddenchange":true,"columnmoved":true,"columnlockchange":true}
 );Roo.grid.ColumnModel.superclass.constructor.call(this);};Roo.extend(Roo.grid.ColumnModel,Roo.util.Observable,{getColumnId:function(A){return this.config[A].id;},getColumnById:function(id){return this.lookup[id];},getColumnByDataIndex:function(A){var B=this.findColumnIndex(A);
 return B>-1?this.config[B]:false;},getIndexById:function(id){for(var i=0,A=this.config.length;i<A;i++){if(this.config[i].id==id){return i;}}return -1;},findColumnIndex:function(A){for(var i=0,B=this.config.length;i<B;i++){if(this.config[i].dataIndex==A){return i;
 }}return -1;},moveColumn:function(A,B){var c=this.config[A];this.config.splice(A,1);this.config.splice(B,0,c);this.dataMap=null;this.fireEvent("columnmoved",this,A,B);},isLocked:function(A){return this.config[A].locked===true;},setLocked:function(A,B,C){if(this.isLocked(A)==B){return;
@@ -1580,8 +1579,9 @@ for(var i=0,B=this.config.length;i<B;i++){var c=this.config[i];if(fn.call(A||thi
 },setColumnHeader:function(A,B){this.config[A].header=B;this.fireEvent("headerchange",this,A,B);},getColumnTooltip:function(A){return this.config[A].tooltip;},setColumnTooltip:function(A,B){this.config[A].tooltip=B;},getDataIndex:function(A){return this.config[A].dataIndex;
 },setDataIndex:function(A,B){this.config[A].dataIndex=B;},isCellEditable:function(A,B){return (this.config[A].editable||(typeof this.config[A].editable=="undefined"&&this.config[A].editor))?true:false;},getCellEditor:function(A,B){return this.config[A].editor;
 },setEditable:function(A,B){this.config[A].editable=B;},isHidden:function(A){return this.config[A].hidden;},isFixed:function(A){return this.config[A].fixed;},isResizable:function(A){return A>=0&&this.config[A].resizable!==false&&this.config[A].fixed!==true;
-},setHidden:function(A,B){this.config[A].hidden=B;this.totalWidth=null;this.fireEvent("hiddenchange",this,A,B);},setEditor:function(A,B){this.config[A].editor=B;}});Roo.grid.ColumnModel.defaultRenderer=function(A){if(typeof A=="object"){return A;}if(typeof A=="string"&&A.length<1){return "&#160;";
-}return String.format("{0}",A);};Roo.grid.DefaultColumnModel=Roo.grid.ColumnModel;
+},setHidden:function(A,B){this.config[A].hidden=B;this.totalWidth=null;this.fireEvent("hiddenchange",this,A,B);},setEditor:function(A,B){this.config[A].editor=B;},addColumn:function(c){var i=this.config.length;if(typeof c.dataIndex=="undefined"){c.dataIndex=i;
+}if(typeof c.renderer=="string"){c.renderer=Roo.util.Format[c.renderer];}if(typeof c.id=="undefined"){c.id=Roo.id();}if(c.editor&&c.editor.xtype){c.editor=Roo.factory(c.editor,Roo.grid);}if(c.editor&&c.editor.isFormField){c.editor=new Roo.grid.GridEditor(c.editor);
+}this.lookup[c.id]=c;}});Roo.grid.ColumnModel.defaultRenderer=function(A){if(typeof A=="object"){return A;}if(typeof A=="string"&&A.length<1){return "&#160;";}return String.format("{0}",A);};Roo.grid.DefaultColumnModel=Roo.grid.ColumnModel;
 // Roo/grid/AbstractSelectionModel.js
 Roo.grid.AbstractSelectionModel=function(){this.locked=false;Roo.grid.AbstractSelectionModel.superclass.constructor.call(this);};Roo.extend(Roo.grid.AbstractSelectionModel,Roo.util.Observable,{init:function(A){this.grid=A;this.initEvents();},lock:function(){this.locked=true;
 },unlock:function(){this.locked=false;},isLocked:function(){return this.locked;}});