colorbrewer/colorbrewer-bg.css
[roojs1] / roojs-debug.js
index c82216c..a1aba75 100644 (file)
@@ -68,7 +68,7 @@ Roo.apply = function(o, c, defaults){
             document.execCommand("BackgroundImageCache", false, true);
         }catch(e){}
     }
-
+    
     Roo.apply(Roo, {
         /**
          * True if the browser is in strict mode
@@ -2471,8 +2471,14 @@ Roo.lib.Event = function() {
  */
 
 (function() {
-    
+    /**
+     * @class Roo.lib.Ajax
+     *
+     */
     Roo.lib.Ajax = {
+        /**
+         * @static 
+         */
         request : function(method, uri, cb, data, options) {
             if(options){
                 var hs = options.headers;
@@ -8854,7 +8860,8 @@ if(opt.anim.isAnimated()){
          * @param {String} msgCls (optional) A css class to apply to the msg element
          * @return {Element} The mask  element
          */
-        mask : function(msg, msgCls){
+        mask : function(msg, msgCls)
+        {
             if(this.getStyle("position") == "static"){
                 this.setStyle("position", "relative");
             }
@@ -8863,6 +8870,23 @@ if(opt.anim.isAnimated()){
             }
             this.addClass("x-masked");
             this._mask.setDisplayed(true);
+            
+            // we wander
+            var z = 0;
+            var dom = this.dom
+            while (dom && dom.style) {
+                if (!isNaN(parseInt(dom.style.zIndex))) {
+                    z = Math.max(z, parseInt(dom.style.zIndex));
+                }
+                dom = dom.parentNode;
+            }
+            // if we are masking the body - then it hides everything..
+            if (this.dom == document.body) {
+                z = 1000000;
+                this._mask.setWidth(Roo.lib.Dom.getDocumentWidth());
+                this._mask.setHeight(Roo.lib.Dom.getDocumentHeight());
+            }
+           
             if(typeof msg == 'string'){
                 if(!this._maskMsg){
                     this._maskMsg = Roo.DomHelper.append(this.dom, {cls:"roo-el-mask-msg", cn:{tag:'div'}}, true);
@@ -8872,10 +8896,13 @@ if(opt.anim.isAnimated()){
                 mm.dom.firstChild.innerHTML = msg;
                 mm.setDisplayed(true);
                 mm.center(this);
+                mm.setStyle('z-index', z + 102);
             }
             if(Roo.isIE && !(Roo.isIE7 && Roo.isStrict) && this.getStyle('height') == 'auto'){ // ie will not expand full height automatically
                 this._mask.setHeight(this.getHeight());
             }
+            this._mask.setStyle('z-index', z + 100);
+            
             return this._mask;
         },
 
@@ -11548,84 +11575,31 @@ Roo.Ajax = new Roo.data.Connection({
  */
  
 /**
+ * Global Ajax request class.
+ * 
  * @class Roo.Ajax
  * @extends Roo.data.Connection
- * Global Ajax request class.
- *
- * @instanceOf  Roo.data.Connection
+ * @static
+ * 
+ * @cfg {String} url  The default URL to be used for requests to the server. (defaults to undefined)
+ * @cfg {Object} extraParams  An object containing properties which are used as extra parameters to each request made by this object. (defaults to undefined)
+ * @cfg {Object} defaultHeaders  An object containing request headers which are added to each request made by this object. (defaults to undefined)
+ * @cfg {String} method (Optional)  The default HTTP method to be used for requests. (defaults to undefined; if not set but parms are present will use POST, otherwise GET)
+ * @cfg {Number} timeout (Optional) The timeout in milliseconds to be used for requests. (defaults to 30000)
+ * @cfg {Boolean} autoAbort (Optional) Whether a new request should abort any pending requests. (defaults to false)
+ * @cfg {Boolean} disableCaching (Optional)   True to add a unique cache-buster param to GET requests. (defaults to true)
  */
 Roo.Ajax = new Roo.data.Connection({
     // fix up the docs
-    
     /**
-     * fix up scoping
      * @scope Roo.Ajax
-     */
-    
-   /**
-     * @cfg {String} url @hide
-     */
-    /**
-     * @cfg {Object} extraParams @hide
-     */
-    /**
-     * @cfg {Object} defaultHeaders @hide
-     */
-    /**
-     * @cfg {String} method (Optional) @hide
-     */
-    /**
-     * @cfg {Number} timeout (Optional) @hide
-     */
-    /**
-     * @cfg {Boolean} autoAbort (Optional) @hide
-     */
-
-    /**
-     * @cfg {Boolean} disableCaching (Optional) @hide
-     */
-
-    /**
-     * @property  disableCaching
-     * True to add a unique cache-buster param to GET requests. (defaults to true)
-     * @type Boolean
-     */
-    /**
-     * @property  url
-     * The default URL to be used for requests to the server. (defaults to undefined)
-     * @type String
-     */
-    /**
-     * @property  extraParams
-     * An object containing properties which are used as
-     * extra parameters to each request made by this object. (defaults to undefined)
-     * @type Object
-     */
-    /**
-     * @property  defaultHeaders
-     * An object containing request headers which are added to each request made by this object. (defaults to undefined)
-     * @type Object
-     */
-    /**
-     * @property  method
-     * The default HTTP method to be used for requests. (defaults to undefined; if not set but parms are present will use POST, otherwise GET)
-     * @type String
-     */
-    /**
-     * @property  timeout
-     * The timeout in milliseconds to be used for requests. (defaults to 30000)
-     * @type Number
-     */
-
-    /**
-     * @property  autoAbort
-     * Whether a new request should abort any pending requests. (defaults to false)
-     * @type Boolean
+     * @type {Boolear} 
      */
     autoAbort : false,
 
     /**
      * Serialize the passed form into a url encoded string
+     * @scope Roo.Ajax
      * @param {String/HTMLElement} form
      * @return {String}
      */
@@ -19547,6 +19521,11 @@ Roo.extend(Roo.data.Store, Roo.util.Observable, {
         }
         // if data returned failure - throw an exception.
         if (o.success === false) {
+            // show a message if no listener is registered.
+            if (!this.hasListener('loadexception') && typeof(this.reader.jsonData.errorMsg) != 'undefined') {
+                    Roo.MessageBox.alert("Error loading",this.reader.jsonData.errorMsg);
+            }
+            // loadmask wil be hooked into this..
             this.fireEvent("loadexception", this, o, options, this.reader.jsonData);
             return;
         }
@@ -19577,6 +19556,7 @@ Roo.extend(Roo.data.Store, Roo.util.Observable, {
         }
     },
 
+
     /**
      * Loads data from a passed data block. A Reader which understands the format of the data
      * must have been configured in the constructor.
@@ -19819,7 +19799,7 @@ Roo.extend(Roo.data.Store, Roo.util.Observable, {
         }
         this.fireEvent("update", this, record, Roo.data.Record.EDIT);
     },
-
+    
     // private
     afterReject : function(record){
         this.modified.remove(record);
@@ -21152,6 +21132,8 @@ Roo.data.Node = function(attributes){
         this.id = Roo.id(null, "ynode-");
         this.attributes.id = this.id;
     }
+     
+    
     /**
      * All child nodes of this node. @type Array
      */
@@ -21876,20 +21858,23 @@ Roo.Component = function(config){
     }
 };
 
-// private
+/** @private */
 Roo.Component.AUTO_ID = 1000;
 
 Roo.extend(Roo.Component, Roo.util.Observable, {
     /**
-     * @property {Boolean} hidden
+     * @scope Roo.Component.prototype
+     * @type {Boolean}
      * true if this component is hidden. Read-only.
      */
     hidden : false,
     /**
+     * @type {Boolean}
      * true if this component is disabled. Read-only.
      */
     disabled : false,
     /**
+     * @type {Boolean}
      * true if this component has been rendered. Read-only.
      */
     rendered : false,
@@ -21909,16 +21894,17 @@ Roo.extend(Roo.Component, Roo.util.Observable, {
      */
     hideMode: 'display',
 
-    // private
+    /** @private */
     ctype : "Roo.Component",
 
-    /** @cfg {String} actionMode 
+    /**
+     * @cfg {String} actionMode 
      * which property holds the element that used for  hide() / show() / disable() / enable()
      * default is 'el' 
      */
     actionMode : "el",
 
-    // private
+    /** @private */
     getActionEl : function(){
         return this[this.actionMode];
     },
@@ -21965,7 +21951,7 @@ Roo.extend(Roo.Component, Roo.util.Observable, {
         return this;
     },
 
-    // private
+    /** @private */
     // default function is not really useful
     onRender : function(ct, position){
         if(this.el){
@@ -21976,7 +21962,7 @@ Roo.extend(Roo.Component, Roo.util.Observable, {
         }
     },
 
-    // private
+    /** @private */
     getAutoCreate : function(){
         var cfg = typeof this.autoCreate == "object" ?
                       this.autoCreate : Roo.apply({}, this.defaultAutoCreate);
@@ -21986,7 +21972,7 @@ Roo.extend(Roo.Component, Roo.util.Observable, {
         return cfg;
     },
 
-    // private
+    /** @private */
     afterRender : Roo.emptyFn,
 
     /**
@@ -22010,12 +21996,12 @@ Roo.extend(Roo.Component, Roo.util.Observable, {
         }
     },
 
-       // private
+       /** @private */
     beforeDestroy : function(){
 
     },
 
-       // private
+       /** @private */
        onDestroy : function(){
 
     },
@@ -22051,7 +22037,7 @@ Roo.extend(Roo.Component, Roo.util.Observable, {
         return this;
     },
 
-    // private
+    /** @private */
     blur : function(){
         if(this.rendered){
             this.el.blur();
@@ -30122,14 +30108,35 @@ Roo.MessageBox = function(){
                 dlg.resizeTo(this.maxWidth, 100); // resize first so content is never clipped from previous shows
             }
             msgEl.innerHTML = text || ' ';
-            var w = Math.max(Math.min(opt.width || msgEl.offsetWidth, this.maxWidth), 
-                        Math.max(opt.minWidth || this.minWidth, bwidth));
+      
+            var cw =  Math.max(msgEl.offsetWidth, msgEl.parentNode.scrollWidth);
+            //Roo.log("guesed size: " + JSON.stringify([cw,msgEl.offsetWidth, msgEl.parentNode.scrollWidth]));
+            var w = Math.max(
+                    Math.min(opt.width || cw , this.maxWidth), 
+                    Math.max(opt.minWidth || this.minWidth, bwidth)
+            );
             if(opt.prompt){
                 activeTextEl.setWidth(w);
             }
             if(dlg.isVisible()){
                 dlg.fixedcenter = false;
             }
+            // to big, make it scroll. = But as usual stupid IE does not support
+            // !important..
+            
+            if ( bodyEl.getHeight() > (Roo.lib.Dom.getViewHeight() - 100)) {
+                bodyEl.setHeight ( Roo.lib.Dom.getViewHeight() - 100 );
+                bodyEl.dom.style.overflowY = 'auto' + ( Roo.isIE ? '' : ' !important');
+            } else {
+                bodyEl.dom.style.height = '';
+                bodyEl.dom.style.overflowY = '';
+            }
+            if (cw > w) {
+                bodyEl.dom.style.get = 'auto' + ( Roo.isIE ? '' : ' !important');
+            } else {
+                bodyEl.dom.style.overflowX = '';
+            }
+            
             dlg.setContentSize(w, bodyEl.getHeight());
             if(dlg.isVisible()){
                 dlg.fixedcenter = true;
@@ -30228,9 +30235,19 @@ Roo.Msg.show({
          * @param {Object} config Configuration options
          * @return {Roo.MessageBox} This message box
          */
-        show : function(options){
+        show : function(options)
+        {
+            
+            // this causes nightmares if you show one dialog after another
+            // especially on callbacks..
+             
             if(this.isVisible()){
+                
                 this.hide();
+                Roo.log("Old Dialog Message:" +  msgEl.innerHTML )
+                //this.alert("ERROR", "Multiple dialogs where displayed at the same time");
+                //throw "Roo.MessageBox ERROR : Multiple dialogs where displayed at the same time";
+                
             }
             var d = this.getDialog();
             opt = options;
@@ -30900,9 +30917,10 @@ Roo.QuickTips.tips = Roo.QuickTips.register;/*
  * @cfg {Boolean} singleExpand true if only 1 node per branch may be expanded
  * @cfg {Boolean} selModel A tree selection model to use with this TreePanel (defaults to a {@link Roo.tree.DefaultSelectionModel})
  * @cfg {Boolean} loader A TreeLoader for use with this TreePanel
+ * @cfg {Object|Roo.tree.TreeEditor} editor The TreeEditor or xtype data to display when clicked.
  * @cfg {String} pathSeparator The token used to separate sub-paths in path strings (defaults to '/')
- * @cfg {Function} renderer Sets the rendering (formatting) function for the nodes. to return HTML markup for the tree view. The render function is called with  the following parameters:<ul><li>The {Object} The data for the node.</li></ul>
- * @cfg {Function} rendererTip Sets the rendering (formatting) function for the nodes hovertip to return HTML markup for the tree view. The render function is called with  the following parameters:<ul><li>The {Object} The data for the node.</li></ul>
+ * @cfg {Function} renderer DEPRECATED - use TreeLoader:create event / Sets the rendering (formatting) function for the nodes. to return HTML markup for the tree view. The render function is called with  the following parameters:<ul><li>The {Object} The data for the node.</li></ul>
+ * @cfg {Function} rendererTip DEPRECATED - use TreeLoader:create event / Sets the rendering (formatting) function for the nodes hovertip to return HTML markup for the tree view. The render function is called with  the following parameters:<ul><li>The {Object} The data for the node.</li></ul>
  * 
  * @constructor
  * @param {String/HTMLElement/Element} el The container element
@@ -30934,8 +30952,8 @@ Roo.tree.TreePanel = function(el, config){
    /**
     * Read-only. The id of the container element becomes this TreePanel's id.
     */
-   this.id = this.el.id;
-   this.addEvents({
+    this.id = this.el.id;
+    this.addEvents({
         /**
         * @event beforeload
         * Fires before a node is loaded, return false to cancel
@@ -31032,87 +31050,96 @@ Roo.tree.TreePanel = function(el, config){
         * @param {Node} node The node
         */
         "beforechildrenrendered":true,
+        /**
+        * @event startdrag
+        * Fires when a node starts being dragged
+        * @param {Roo.tree.TreePanel} this
+        * @param {Roo.tree.TreeNode} node
+        * @param {event} e The raw browser event
+        */ 
+       "startdrag" : true,
        /**
-            * @event startdrag
-            * Fires when a node starts being dragged
-            * @param {Roo.tree.TreePanel} this
-            * @param {Roo.tree.TreeNode} node
-            * @param {event} e The raw browser event
-            */ 
-           "startdrag" : true,
-           /**
-            * @event enddrag
-            * Fires when a drag operation is complete
-            * @param {Roo.tree.TreePanel} this
-            * @param {Roo.tree.TreeNode} node
-            * @param {event} e The raw browser event
-            */
-           "enddrag" : true,
-           /**
-            * @event dragdrop
-            * Fires when a dragged node is dropped on a valid DD target
-            * @param {Roo.tree.TreePanel} this
-            * @param {Roo.tree.TreeNode} node
-            * @param {DD} dd The dd it was dropped on
-            * @param {event} e The raw browser event
-            */
-           "dragdrop" : true,
-           /**
-            * @event beforenodedrop
-            * Fires when a DD object is dropped on a node in this tree for preprocessing. Return false to cancel the drop. The dropEvent
-            * passed to handlers has the following properties:<br />
-            * <ul style="padding:5px;padding-left:16px;">
-            * <li>tree - The TreePanel</li>
-            * <li>target - The node being targeted for the drop</li>
-            * <li>data - The drag data from the drag source</li>
-            * <li>point - The point of the drop - append, above or below</li>
-            * <li>source - The drag source</li>
-            * <li>rawEvent - Raw mouse event</li>
-            * <li>dropNode - Drop node(s) provided by the source <b>OR</b> you can supply node(s)
-            * to be inserted by setting them on this object.</li>
-            * <li>cancel - Set this to true to cancel the drop.</li>
-            * </ul>
-            * @param {Object} dropEvent
-            */
-           "beforenodedrop" : true,
-           /**
-            * @event nodedrop
-            * Fires after a DD object is dropped on a node in this tree. The dropEvent
-            * passed to handlers has the following properties:<br />
-            * <ul style="padding:5px;padding-left:16px;">
-            * <li>tree - The TreePanel</li>
-            * <li>target - The node being targeted for the drop</li>
-            * <li>data - The drag data from the drag source</li>
-            * <li>point - The point of the drop - append, above or below</li>
-            * <li>source - The drag source</li>
-            * <li>rawEvent - Raw mouse event</li>
-            * <li>dropNode - Dropped node(s).</li>
-            * </ul>
-            * @param {Object} dropEvent
-            */
-           "nodedrop" : true,
-            /**
-            * @event nodedragover
-            * Fires when a tree node is being targeted for a drag drop, return false to signal drop not allowed. The dragOverEvent
-            * passed to handlers has the following properties:<br />
-            * <ul style="padding:5px;padding-left:16px;">
-            * <li>tree - The TreePanel</li>
-            * <li>target - The node being targeted for the drop</li>
-            * <li>data - The drag data from the drag source</li>
-            * <li>point - The point of the drop - append, above or below</li>
-            * <li>source - The drag source</li>
-            * <li>rawEvent - Raw mouse event</li>
-            * <li>dropNode - Drop node(s) provided by the source.</li>
-            * <li>cancel - Set this to true to signal drop not allowed.</li>
-            * </ul>
-            * @param {Object} dragOverEvent
-            */
-           "nodedragover" : true
+        * @event enddrag
+        * Fires when a drag operation is complete
+        * @param {Roo.tree.TreePanel} this
+        * @param {Roo.tree.TreeNode} node
+        * @param {event} e The raw browser event
+        */
+       "enddrag" : true,
+       /**
+        * @event dragdrop
+        * Fires when a dragged node is dropped on a valid DD target
+        * @param {Roo.tree.TreePanel} this
+        * @param {Roo.tree.TreeNode} node
+        * @param {DD} dd The dd it was dropped on
+        * @param {event} e The raw browser event
+        */
+       "dragdrop" : true,
+       /**
+        * @event beforenodedrop
+        * Fires when a DD object is dropped on a node in this tree for preprocessing. Return false to cancel the drop. The dropEvent
+        * passed to handlers has the following properties:<br />
+        * <ul style="padding:5px;padding-left:16px;">
+        * <li>tree - The TreePanel</li>
+        * <li>target - The node being targeted for the drop</li>
+        * <li>data - The drag data from the drag source</li>
+        * <li>point - The point of the drop - append, above or below</li>
+        * <li>source - The drag source</li>
+        * <li>rawEvent - Raw mouse event</li>
+        * <li>dropNode - Drop node(s) provided by the source <b>OR</b> you can supply node(s)
+        * to be inserted by setting them on this object.</li>
+        * <li>cancel - Set this to true to cancel the drop.</li>
+        * </ul>
+        * @param {Object} dropEvent
+        */
+       "beforenodedrop" : true,
+       /**
+        * @event nodedrop
+        * Fires after a DD object is dropped on a node in this tree. The dropEvent
+        * passed to handlers has the following properties:<br />
+        * <ul style="padding:5px;padding-left:16px;">
+        * <li>tree - The TreePanel</li>
+        * <li>target - The node being targeted for the drop</li>
+        * <li>data - The drag data from the drag source</li>
+        * <li>point - The point of the drop - append, above or below</li>
+        * <li>source - The drag source</li>
+        * <li>rawEvent - Raw mouse event</li>
+        * <li>dropNode - Dropped node(s).</li>
+        * </ul>
+        * @param {Object} dropEvent
+        */
+       "nodedrop" : true,
+        /**
+        * @event nodedragover
+        * Fires when a tree node is being targeted for a drag drop, return false to signal drop not allowed. The dragOverEvent
+        * passed to handlers has the following properties:<br />
+        * <ul style="padding:5px;padding-left:16px;">
+        * <li>tree - The TreePanel</li>
+        * <li>target - The node being targeted for the drop</li>
+        * <li>data - The drag data from the drag source</li>
+        * <li>point - The point of the drop - append, above or below</li>
+        * <li>source - The drag source</li>
+        * <li>rawEvent - Raw mouse event</li>
+        * <li>dropNode - Drop node(s) provided by the source.</li>
+        * <li>cancel - Set this to true to signal drop not allowed.</li>
+        * </ul>
+        * @param {Object} dragOverEvent
+        */
+       "nodedragover" : true
         
-   });
-   if(this.singleExpand){
+    });
+    if(this.singleExpand){
        this.on("beforeexpand", this.restrictExpand, this);
-   }
+    }
+    if (this.editor) {
+        this.editor.tree = this;
+        this.editor = Roo.factory(this.editor, Roo.tree);
+    }
+    
+    if (this.selModel) {
+        this.selModel = Roo.factory(this.selModel, Roo.tree);
+    }
+   
 };
 Roo.extend(Roo.tree.TreePanel, Roo.data.Tree, {
     rootVisible : true,
@@ -31316,8 +31343,8 @@ Roo.extend(Roo.tree.TreePanel, Roo.data.Tree, {
         }
         this.getSelectionModel().init(this);
         if (!this.root) {
-            console.log("ROOT not set in tree");
-            return;
+            Roo.log("ROOT not set in tree");
+            return this;
         }
         this.root.render();
         if(!this.rootVisible){
@@ -31341,10 +31368,13 @@ Roo.extend(Roo.tree.TreePanel, Roo.data.Tree, {
  * @class Roo.tree.DefaultSelectionModel
  * @extends Roo.util.Observable
  * The default single selection for a TreePanel.
+ * @param {Object} cfg Configuration
  */
-Roo.tree.DefaultSelectionModel = function(){
+Roo.tree.DefaultSelectionModel = function(cfg){
    this.selNode = null;
    
+   
+   
    this.addEvents({
        /**
         * @event selectionchange
@@ -31363,6 +31393,8 @@ Roo.tree.DefaultSelectionModel = function(){
         */
        "beforeselect" : true
    });
+   
+    Roo.tree.DefaultSelectionModel.superclass.constructor.call(this,cfg);
 };
 
 Roo.extend(Roo.tree.DefaultSelectionModel, Roo.util.Observable, {
@@ -31533,6 +31565,7 @@ Roo.extend(Roo.tree.DefaultSelectionModel, Roo.util.Observable, {
  * @class Roo.tree.MultiSelectionModel
  * @extends Roo.util.Observable
  * Multi selection for a TreePanel.
+ * @param {Object} cfg Configuration
  */
 Roo.tree.MultiSelectionModel = function(){
    this.selNodes = [];
@@ -31546,6 +31579,8 @@ Roo.tree.MultiSelectionModel = function(){
         */
        "selectionchange" : true
    });
+   Roo.tree.MultiSelectionModel.superclass.constructor.call(this,cfg);
+   
 };
 
 Roo.extend(Roo.tree.MultiSelectionModel, Roo.util.Observable, {
@@ -31800,6 +31835,20 @@ Roo.tree.TreeNode = function(attributes){
      * @type TreeNodeUI
      */
     this.ui = new uiClass(this);
+    
+    // finally support items[]
+    if (typeof(this.attributes.items) == 'undefined' || !this.attributes.items) {
+        return;
+    }
+    
+    
+    Roo.each(this.attributes.items, function(c) {
+        this.appendChild(Roo.factory(c,Roo.Tree));
+    }, this);
+    delete this.attributes.items;
+    
+    
+    
 };
 Roo.extend(Roo.tree.TreeNode, Roo.data.Node, {
     preventHScroll: true,
@@ -31845,7 +31894,8 @@ Roo.extend(Roo.tree.TreeNode, Roo.data.Node, {
 
     // these methods are overridden to provide lazy rendering support
     // private override
-    appendChild : function(){
+    appendChild : function()
+    {
         var node = Roo.tree.TreeNode.superclass.appendChild.apply(this, arguments);
         if(node && this.childrenRendered){
             node.render();
@@ -32625,11 +32675,15 @@ Roo.tree.TreeNodeUI.prototype = {
         }
     },
 
-    renderElements : function(n, a, targetNode, bulkRender){
+    renderElements : function(n, a, targetNode, bulkRender)
+    {
         // add some indent caching, this helps performance when rendering a large tree
         this.indentMarkup = n.parentNode ? n.parentNode.ui.getChildIndent() : '';
         var t = n.getOwnerTree();
         var txt = t.renderer ? t.renderer(n.attributes) : Roo.util.Format.htmlEncode(n.text);
+        if (typeof(n.attributes.html) != 'undefined') {
+            txt = n.attributes.html;
+        }
         var tip = t.rendererTip ? t.rendererTip(n.attributes) : txt;
         var cb = typeof a.checked == 'boolean';
         var href = a.href ? a.href : Roo.isGecko ? "" : "#";
@@ -32706,7 +32760,10 @@ Roo.tree.TreeNodeUI.prototype = {
                     this.c1 = c1; this.c2 = c2;
                 }
             }else{
-                if(!this.wasLeaf){
+                // this changes non-leafs into leafs if they have no children.
+                // it's not very rational behaviour..
+                
+                if(!this.wasLeaf && this.node.leaf){
                     Roo.fly(this.elNode).replaceClass("x-tree-node-expanded", "x-tree-node-leaf");
                     delete this.c1;
                     delete this.c2;
@@ -32871,7 +32928,7 @@ Roo.extend(Roo.tree.TreeLoader, Roo.util.Observable, {
     /**
     * @cfg {Object} uiProviders (optional) An object containing properties which
     * 
-    * DEPRECIATED - use 'create' event handler to modify attributes - which affect creation.
+    * DEPRECATED - use 'create' event handler to modify attributes - which affect creation.
     * specify custom {@link Roo.tree.TreeNodeUI} implementations. If the optional
     * <i>uiProvider</i> attribute of a returned child node is a string rather
     * than a reference to a TreeNodeUI implementation, this that string value
@@ -33559,13 +33616,42 @@ Roo.extend(Roo.tree.TreeDragZone, Roo.dd.DragZone, {
  * Provides editor functionality for inline tree node editing.  Any valid {@link Roo.form.Field} can be used
  * as the editor field.
  * @constructor
- * @param {TreePanel} tree
- * @param {Object} config Either a prebuilt {@link Roo.form.Field} instance or a Field config object
+ * @param {Object} config (used to be the tree panel.)
+ * @param {Object} oldconfig DEPRECIATED Either a prebuilt {@link Roo.form.Field} instance or a Field config object
+ * 
+ * @cfg {Roo.tree.TreePanel} tree The tree to bind to.
+ * @cfg {Roo.form.TextField|Object} field The field configuration
+ *
+ * 
  */
-Roo.tree.TreeEditor = function(tree, config){
+Roo.tree.TreeEditor = function(config, oldconfig) { // was -- (tree, config){
+    var tree = config;
+    var field;
+    if (oldconfig) { // old style..
+        field = oldconfig.events ? oldconfig : new Roo.form.TextField(oldconfig);
+    } else {
+        // new style..
+        tree = config.tree;
+        config.field = config.field  || {};
+        config.field.xtype = 'TextField';
+        field = Roo.factory(config.field, Roo.form);
+    }
     config = config || {};
-    var field = config.events ? config : new Roo.form.TextField(config);
-    Roo.tree.TreeEditor.superclass.constructor.call(this, field);
+    
+    
+    this.addEvents({
+        /**
+         * @event beforenodeedit
+         * Fires when editing is initiated, but before the value changes.  Editing can be canceled by returning
+         * false from the handler of this event.
+         * @param {Editor} this
+         * @param {Roo.tree.Node} node 
+         */
+        "beforenodeedit" : true
+    });
+    
+    //Roo.log(config);
+    Roo.tree.TreeEditor.superclass.constructor.call(this, field, config);
 
     this.tree = tree;
 
@@ -33622,6 +33708,9 @@ Roo.extend(Roo.tree.TreeEditor, Roo.Editor, {
                 this.maxWidth,
                 (td.clientWidth > 20 ? td.clientWidth : td.offsetWidth) - Math.max(0, nd.offsetLeft-td.scrollLeft) - /*cushion*/5);
         this.setSize(w, '');
+        
+        return this.fireEvent('beforenodeedit', this, this.editNode);
+        
     },
 
     // private
@@ -33645,6 +33734,7 @@ Roo.extend(Roo.tree.TreeEditor, Roo.Editor, {
             this.triggerEdit(node);
             return false;
         }
+        return true;
     },
 
     // private
@@ -35877,7 +35967,7 @@ side          Add an error icon to the right of the field with a popup on hover
         this.value = v;
         if(this.rendered){
             this.el.dom.value = (v === null || v === undefined ? '' : v);
-            this.validate();
+             this.validate();
         }
     },
 
@@ -36822,6 +36912,7 @@ Roo.extend(Roo.form.NumberField, Roo.form.TextField,  {
     },
 
     setValue : function(v){
+        v = this.fixPrecision(v);
         Roo.form.NumberField.superclass.setValue.call(this, String(v).replace(".", this.decimalSeparator));
     },
 
@@ -36833,7 +36924,7 @@ Roo.extend(Roo.form.NumberField, Roo.form.TextField,  {
     beforeBlur : function(){
         var v = this.parseValue(this.getRawValue());
         if(v){
-            this.setValue(this.fixPrecision(v));
+            this.setValue(v);
         }
     }
 });/*
@@ -37338,6 +37429,8 @@ Roo.extend(Roo.form.ComboBox, Roo.form.TriggerField, {
      * in order for a value to be mapped.
      */
     valueField: undefined,
+    
+    
     /**
      * @cfg {String} hiddenName If specified, a hidden form field with this name is dynamically generated to store the
      * field's data value (defaults to the underlying DOM element's name)
@@ -37468,7 +37561,8 @@ Roo.extend(Roo.form.ComboBox, Roo.form.TriggerField, {
     addicon : false,
     editicon: false,
     
-    
+    // element that contains real text value.. (when hidden is used..)
+     
     // private
     onRender : function(ct, position){
         Roo.form.ComboBox.superclass.onRender.call(this, ct, position);
@@ -37481,6 +37575,8 @@ Roo.extend(Roo.form.ComboBox, Roo.form.TriggerField, {
 
             // prevent input submission
             this.el.dom.removeAttribute('name');
+             
+             
         }
         if(Roo.isGecko){
             this.el.dom.setAttribute('autocomplete', 'off');
@@ -37549,7 +37645,7 @@ Roo.extend(Roo.form.ComboBox, Roo.form.TriggerField, {
 
         this.store.on('beforeload', this.onBeforeLoad, this);
         this.store.on('load', this.onLoad, this);
-        this.store.on('loadexception', this.collapse, this);
+        this.store.on('loadexception', this.onLoadException, this);
 
         if(this.resizable){
             this.resizer = new Roo.Resizable(this.list,  {
@@ -37669,7 +37765,7 @@ Roo.extend(Roo.form.ComboBox, Roo.form.TriggerField, {
         if(this.store){
             this.store.un('beforeload', this.onBeforeLoad, this);
             this.store.un('load', this.onLoad, this);
-            this.store.un('loadexception', this.collapse, this);
+            this.store.un('loadexception', this.onLoadException, this);
         }
         Roo.form.ComboBox.superclass.onDestroy.call(this);
     },
@@ -37766,7 +37862,17 @@ Roo.extend(Roo.form.ComboBox, Roo.form.TriggerField, {
         }
         //this.el.focus();
     },
-
+    // private
+    onLoadException : function()
+    {
+        this.collapse();
+        Roo.log(this.store.reader.jsonData);
+        if (this.store && typeof(this.store.reader.jsonData.errorMsg) != 'undefined') {
+            Roo.MessageBox.alert("Error loading",this.store.reader.jsonData.errorMsg);
+        }
+        
+        
+    },
     // private
     onTypeAhead : function(){
         if(this.store.getCount() > 0){
@@ -37894,11 +38000,19 @@ Roo.extend(Roo.form.ComboBox, Roo.form.TriggerField, {
                     record = r;
                     return false;
                 }
+                return true;
             });
         }
         return record;
     },
-
+    
+    getName: function()
+    {
+        // returns hidden if it's set..
+        if (!this.rendered) {return ''};
+        return !this.hiddenName && this.el.dom.name  ? this.el.dom.name : (this.hiddenName || '');
+        
+    },
     // private
     onViewMove : function(e, t){
         this.inKeyMode = false;
@@ -38901,7 +39015,7 @@ Roo.form.HtmlEditor = Roo.extend(Roo.form.Field, {
     syncValue : function(){
         if(this.initialized){
             var bd = (this.doc.body || this.doc.documentElement);
-            this.cleanUpPaste();
+            //this.cleanUpPaste();
             var html = bd.innerHTML;
             if(Roo.isSafari){
                 var bs = bd.getAttribute('style'); // Safari puts text-align styles on the body element!
@@ -39079,7 +39193,7 @@ Roo.form.HtmlEditor = Roo.extend(Roo.form.Field, {
     onEditorEvent : function(e){
         this.fireEvent('editorevent', this, e);
       //  this.updateToolbar();
-        this.syncValue();
+        this.syncValue(); //we can not sync so often.. sync cleans, so this breaks stuff
     },
 
     insertTag : function(tg)
@@ -39173,6 +39287,7 @@ Roo.form.HtmlEditor = Roo.extend(Roo.form.Field, {
                     break;
                     case 'u':
                         cmd = 'underline';
+                        break;
                     case 'v':
                         this.cleanUpPaste.defer(100, this);
                         return;
@@ -39475,11 +39590,28 @@ Roo.form.HtmlEditor = Roo.extend(Roo.form.Field, {
     cleanUpPaste :  function()
     {
         // cleans up the whole document..
-      //  console.log('cleanuppaste');
+         Roo.log('cleanuppaste');
         this.cleanUpChildren(this.doc.body);
+        var clean = this.cleanWordChars(this.doc.body.innerHTML);
+        if (clean != this.doc.body.innerHTML) {
+            this.doc.body.innerHTML = clean;
+        }
         
+    },
+    
+    cleanWordChars : function(input) {
+        var he = Roo.form.HtmlEditor;
+    
+        var output = input;
+        Roo.each(he.swapCodes, function(sw) { 
         
+            var swapper = new RegExp("\\u" + sw[0].toString(16), "g"); // hex codes
+            output = output.replace(swapper, sw[1]);
+        });
+        return output;
     },
+    
+    
     cleanUpChildren : function (n)
     {
         if (!n.childNodes.length) {
@@ -39512,7 +39644,16 @@ Roo.form.HtmlEditor = Roo.extend(Roo.form.Field, {
             return;
             
         }
-        if (Roo.form.HtmlEditor.remove.indexOf(node.tagName.toLowerCase()) > -1) {
+        
+        var remove_keep_children= Roo.form.HtmlEditor.remove.indexOf(node.tagName.toLowerCase()) > -1;
+        
+        // remove <a name=....> as rendering on yahoo mailer is bored with this.
+        
+        if (node.tagName.toLowerCase() == 'a' && !node.hasAttribute('href')) {
+            remove_keep_children = true;
+        }
+        
+        if (remove_keep_children) {
             this.cleanUpChildren(node);
             // inserts everything just before this node...
             while (node.childNodes.length) {
@@ -39587,10 +39728,17 @@ Roo.form.HtmlEditor = Roo.extend(Roo.form.Field, {
                 cleanStyle(a.name,a.value);
             }
             /// clean up MS crap..
+            // tecnically this should be a list of valid class'es..
+            
+            
             if (a.name == 'class') {
                 if (a.value.match(/^Mso/)) {
                     node.className = '';
                 }
+                
+                if (a.value.match(/body/)) {
+                    node.className = '';
+                }
             }
             
             // style cleanup!?
@@ -39701,7 +39849,19 @@ Roo.form.HtmlEditor.cwhite= [
         'font-size'
 ];
 
-// <script type="text/javascript">
+
+Roo.form.HtmlEditor.swapCodes   =[ 
+    [    8211, "--" ], 
+    [    8212, "--" ], 
+    [    8216,  "'" ],  
+    [    8217, "'" ],  
+    [    8220, '"' ],  
+    [    8221, '"' ],  
+    [    8226, "*" ],  
+    [    8230, "..." ]
+]; 
+
+    // <script type="text/javascript">
 /*
  * Based on
  * Ext JS Library 1.1.1
@@ -41203,7 +41363,11 @@ clientValidation  Boolean          Applies to submit only.  Pass true to call fo
             Roo.callback(o.failure, o.scope, [this, action]);
             // show an error message if no failed handler is set..
             if (!this.hasListener('actionfailed')) {
-                Roo.MessageBox.alert("Error", "Saving Failed, please check your entries");
+                Roo.MessageBox.alert("Error",
+                    (typeof(action.result) != 'undefined' && typeof(action.result.errorMsg) != 'undefined') ?
+                        action.result.errorMsg :
+                        "Saving Failed, please check your entries"
+                );
             }
             
             this.fireEvent('actionfailed', this, action);
@@ -41373,10 +41537,12 @@ clientValidation  Boolean          Applies to submit only.  Pass true to call fo
      * This differs from getValues as it calls getValue on each child item, rather than using dom data.
      * @return {Object}
      */
-    getFieldValues : function()
+    getFieldValues : function(with_hidden)
     {
         if (this.childForms) {
             // copy values from the child forms
+            // should this call getFieldValues - probably not as we do not currently copy
+            // hidden fields when we generate..
             Roo.each(this.childForms, function (f) {
                 this.setValues(f.getValues());
             }, this);
@@ -41388,9 +41554,14 @@ clientValidation  Boolean          Applies to submit only.  Pass true to call fo
                 return;
             }
             var v = f.getValue();
+            // not sure if this supported any more..
             if ((typeof(v) == 'object') && f.getRawValue) {
                 v = f.getRawValue() ; // dates..
             }
+            // combo boxes where name != hiddenName...
+            if (f.name != f.getName()) {
+                ret[f.name] = f.getRawValue();
+            }
             ret[f.getName()] = v;
         });
         
@@ -42195,7 +42366,6 @@ Roo.extend(Roo.form.Action.Submit, Roo.form.Action, {
             Roo.MessageBox.hide();
         }
         
-        
         this.response = response;
         this.failureType = Roo.form.Action.CONNECT_FAILURE;
         this.form.afterAction(this, false);
@@ -43137,7 +43307,7 @@ Roo.extend(Roo.form.GridField, Roo.form.Field,  {
             ds.loadData( data);
         }
         // clear selection so it does not get stale.
-        if (this.grid.sm)) { 
+        if (this.grid.sm) { 
             this.grid.sm.clearSelections();
         }
         
@@ -43581,7 +43751,10 @@ Roo.extend(Roo.form.ComboCheck, Roo.form.ComboBox, {
         var ar = [] ;
         
         try {
-            Roo.log(this.value);
+            //Roo.log(this.value);
+            if (typeof(this.value) == 'undefined') {
+                return [];
+            }
             var ar = Roo.decode(this.value);
             return  ar instanceof Array ? ar : []; //?? valid?
             
@@ -44575,12 +44748,18 @@ layout.addxtype({
     {
         // basically accepts a pannel...
         // can accept a layout region..!?!?
-       // console.log('BorderLayout add ' + cfg.xtype)
+        //Roo.log('Roo.BorderLayout add ' + cfg.xtype)
         
         if (!cfg.xtype.match(/Panel$/)) {
             return false;
         }
         var ret = false;
+        
+        if (typeof(cfg.region) == 'undefined') {
+            Roo.log("Failed to add Panel, region was not set");
+            Roo.log(cfg);
+            return false;
+        }
         var region = cfg.region;
         delete cfg.region;
         
@@ -44590,7 +44769,7 @@ layout.addxtype({
             xitems = cfg.items;
             delete cfg.items;
         }
-        
+        var nb = false;
         
         switch(cfg.xtype) 
         {
@@ -44631,7 +44810,7 @@ layout.addxtype({
                 ret = new Roo[cfg.xtype](layout, cfg); // new panel!!!!!
                 //console.log('adding nested layout panel '  + cfg.toSource());
                 this.add(region, ret);
-                
+                nb = {}; /// find first...
                 break;
                 
             case 'GridPanel': 
@@ -44672,10 +44851,37 @@ layout.addxtype({
         }
         this.beginUpdate();
         // add children..
+        var region = '';
+        var abn = {};
         Roo.each(xitems, function(i)  {
-            ret.addxtype(i);
+            region = nb && i.region ? i.region : false;
+            
+            var add = ret.addxtype(i);
+           
+            if (region) {
+                nb[region] = nb[region] == undefined ? 0 : nb[region]+1;
+                if (!i.background) {
+                    abn[region] = nb[region] ;
+                }
+            }
+            
         });
         this.endUpdate();
+
+        // make the last non-background panel active..
+        //if (nb) { Roo.log(abn); }
+        if (nb) {
+            
+            for(var r in abn) {
+                region = this.getRegion(r);
+                if (region) {
+                    // tried using nb[r], but it does not work..
+                     
+                    region.showPanel(abn[r]);
+                   
+                }
+            }
+        }
         return ret;
         
     }
@@ -48556,7 +48762,14 @@ Roo.extend(Roo.grid.GridView, Roo.grid.AbstractGridView, {
         this.rowEl.elements = els;
         return this.rowEl;
     },
-
+    /**
+     * Gets the 'td' of the cell
+     * 
+     * @param {Integer} rowIndex row to select
+     * @param {Integer} colIndex column to select
+     * 
+     * @return {Object} 
+     */
     getCell : function(rowIndex, colIndex){
         var locked = this.cm.getLockedCount();
         var source;
@@ -51015,6 +51228,7 @@ Roo.extend(Roo.grid.RowSelectionModel, Roo.grid.AbstractSelectionModel,  {
  * This class provides the basic implementation for cell selection in a grid.
  * @constructor
  * @param {Object} config The object containing the configuration of this model.
+ * @cfg {Boolean} enter_is_tab Enter behaves the same as tab. (eg. goes to next cell) default: false
  */
 Roo.grid.CellSelectionModel = function(config){
     Roo.apply(this, config);
@@ -51048,12 +51262,21 @@ Roo.grid.CellSelectionModel = function(config){
                <li>o.cell: An array of [rowIndex, columnIndex]</li>
                </ul>
             */
-           "selectionchange" : true
+           "selectionchange" : true,
+        /**
+            * @event tabend
+            * Fires when the tab (or enter) was pressed on the last editable cell
+            * You can use this to trigger add new row.
+            * @param {SelectionModel} this
+            */
+           "tabend" : true
     });
     Roo.grid.CellSelectionModel.superclass.constructor.call(this);
 };
 
 Roo.extend(Roo.grid.CellSelectionModel, Roo.grid.AbstractSelectionModel,  {
+    
+    enter_is_tab: false,
 
     /** @ignore */
     initEvents : function(){
@@ -51162,7 +51385,7 @@ Roo.extend(Roo.grid.CellSelectionModel, Roo.grid.AbstractSelectionModel,  {
 
     /** @ignore */
     handleKeyDown : function(e){
-        Roo.log('Cell Sel Model handleKeyDown');
+        //Roo.log('Cell Sel Model handleKeyDown');
         if(!e.isNavKeyPress()){
             return;
         }
@@ -51182,61 +51405,93 @@ Roo.extend(Roo.grid.CellSelectionModel, Roo.grid.AbstractSelectionModel,  {
         var k = e.getKey(), r = s.cell[0], c = s.cell[1];
         var newCell;
 
+      
+
         switch(k){
             case e.TAB:
                 // handled by onEditorKey
                 if (g.isEditor && g.editing) {
                     return;
                 }
-                if(e.shiftKey){
-                     newCell = walk(r, c-1, -1);
-                }else{
-                     newCell = walk(r, c+1, 1);
+                if(e.shiftKey) {
+                    newCell = walk(r, c-1, -1);
+                } else {
+                    newCell = walk(r, c+1, 1);
                 }
-             break;
-             case e.DOWN:
-                 newCell = walk(r+1, c, 1);
-             break;
-             case e.UP:
-                 newCell = walk(r-1, c, -1);
-             break;
-             case e.RIGHT:
-                 newCell = walk(r, c+1, 1);
-             break;
-             case e.LEFT:
-                 newCell = walk(r, c-1, -1);
-             break;
-             case e.ENTER:
-                 if(g.isEditor && !g.editing){
-                    g.startEditing(r, c);
-                    e.stopEvent();
-                    return;
+                break;
+            
+            case e.DOWN:
+               newCell = walk(r+1, c, 1);
+                break;
+            
+            case e.UP:
+                newCell = walk(r-1, c, -1);
+                break;
+            
+            case e.RIGHT:
+                newCell = walk(r, c+1, 1);
+                break;
+            
+            case e.LEFT:
+                newCell = walk(r, c-1, -1);
+                break;
+            
+            case e.ENTER:
+                
+                if(g.isEditor && !g.editing){
+                   g.startEditing(r, c);
+                   e.stopEvent();
+                   return;
                 }
+                
+                
              break;
         };
         if(newCell){
             this.select(newCell[0], newCell[1]);
             e.stopEvent();
+            
         }
     },
 
     acceptsNav : function(row, col, cm){
         return !cm.isHidden(col) && cm.isCellEditable(col, row);
     },
-
+    /**
+     * Selects a cell.
+     * @param {Number} field (not used) - as it's normally used as a listener
+     * @param {Number} e - event - fake it by using
+     *
+     * var e = Roo.EventObjectImpl.prototype;
+     * e.keyCode = e.TAB
+     *
+     * 
+     */
     onEditorKey : function(field, e){
-        Roo.log("on Editor Key");
-        var k = e.getKey(), newCell, g = this.grid, ed = g.activeEditor;
+        
+        var k = e.getKey(),
+            newCell,
+            g = this.grid,
+            ed = g.activeEditor,
+            forward = false;
         ///Roo.log('onEditorKey' + k);
         
+        
+        if (this.enter_is_tab && k == e.ENTER) {
+            k = e.TAB;
+        }
+        
         if(k == e.TAB){
             if(e.shiftKey){
                 newCell = g.walkCells(ed.row, ed.col-1, -1, this.acceptsNav, this);
             }else{
                 newCell = g.walkCells(ed.row, ed.col+1, 1, this.acceptsNav, this);
+                forward = true;
             }
+            
             e.stopEvent();
-        }else if(k == e.ENTER && !e.ctrlKey){
+            
+        }else if(k == e.ENTER &&  !e.ctrlKey){
             ed.completeEdit();
             e.stopEvent();
             newCell = g.walkCells(ed.row, ed.col+1, 1, this.acceptsNav, this);
@@ -51248,6 +51503,9 @@ Roo.extend(Roo.grid.CellSelectionModel, Roo.grid.AbstractSelectionModel,  {
         if(newCell){
             //Roo.log('next cell after edit');
             g.startEditing.defer(100, g, [newCell[0], newCell[1]]);
+        } else if (forward) {
+            // tabbed past last
+            this.fireEvent.defer(100, this, ['tabend',this]);
         }
     }
 });/*
@@ -51369,6 +51627,9 @@ Roo.extend(Roo.grid.EditorGrid, Roo.grid.Grid, {
             cancel:false,
             editor: ed
         };
+        var cell = Roo.get(this.view.getCell(ed.row,ed.col))
+        cell.show();
+          
         if(String(value) !== String(startValue)){
             
             if(this.fireEvent("validateedit", e) !== false && !e.cancel){
@@ -51397,8 +51658,10 @@ Roo.extend(Roo.grid.EditorGrid, Roo.grid.Grid, {
         this.stopEditing();
         if(this.colModel.isCellEditable(col, row)){
             this.view.ensureVisible(row, col, true);
+          
             var r = this.dataSource.getAt(row);
             var field = this.colModel.getDataIndex(col);
+            var cell = Roo.get(this.view.getCell(row,col));
             var e = {
                 grid: this,
                 record: r,
@@ -51406,7 +51669,7 @@ Roo.extend(Roo.grid.EditorGrid, Roo.grid.Grid, {
                 value: r.data[field],
                 row: row,
                 column: col,
-                cancel:false
+                cancel:false 
             };
             if(this.fireEvent("beforeedit", e) !== false && !e.cancel){
                 this.editing = true;
@@ -51419,12 +51682,15 @@ Roo.extend(Roo.grid.EditorGrid, Roo.grid.Grid, {
                     ed.render(ed.parentEl || document.body);
                 }
                 ed.field.reset();
+               
+                cell.hide();
+                
                 (function(){ // complex but required for focus issues in safari, ie and opera
                     ed.row = row;
                     ed.col = col;
                     ed.record = r;
-                    ed.on("complete", this.onEditComplete, this, {single: true});
-                    ed.on("specialkey", this.selModel.onEditorKey, this.selModel);
+                    ed.on("complete",   this.onEditComplete,        this,       {single: true});
+                    ed.on("specialkey", this.selModel.onEditorKey,  this.selModel);
                     this.activeEditor = ed;
                     var v = r.data[field];
                     ed.startEdit(this.view.getCell(row, col), v);
@@ -51796,7 +52062,7 @@ Roo.LoadMask = function(el, config){
     if(this.store){
         this.store.on('beforeload', this.onBeforeLoad, this);
         this.store.on('load', this.onLoad, this);
-        this.store.on('loadexception', this.onLoad, this);
+        this.store.on('loadexception', this.onLoadException, this);
         this.removeMask = false;
     }else{
         var um = this.el.getUpdateManager();
@@ -51844,9 +52110,17 @@ Roo.LoadMask.prototype = {
     enable : function(){
         this.disabled = false;
     },
-
+    
+    onLoadException : function()
+    {
+        if (this.store && typeof(this.store.reader.jsonData.errorMsg) != 'undefined') {
+            Roo.MessageBox.alert("Error loading",this.store.reader.jsonData.errorMsg);
+        }
+        this.el.unmask(this.removeMask);
+    },
     // private
-    onLoad : function(){
+    onLoad : function()
+    {
         this.el.unmask(this.removeMask);
     },
 
@@ -51862,7 +52136,7 @@ Roo.LoadMask.prototype = {
         if(this.store){
             this.store.un('beforeload', this.onBeforeLoad, this);
             this.store.un('load', this.onLoad, this);
-            this.store.un('loadexception', this.onLoad, this);
+            this.store.un('loadexception', this.onLoadException, this);
         }else{
             var um = this.el.getUpdateManager();
             um.un('beforeupdate', this.onBeforeLoad, this);