X-Git-Url: http://git.roojs.org/?p=roojs1;a=blobdiff_plain;f=roojs-debug.js;h=130983fd41fb57aacdeb475236577cb9a4064767;hp=ffc80b2da0b6a79eed1f2a7273dca57186aabff9;hb=refs%2Fheads%2Fwip_alan_T6102_issue_with_word_clean;hpb=86a3c3c0348572a93a9788fbf9c724e7db362afe diff --git a/roojs-debug.js b/roojs-debug.js index ffc80b2da0..130983fd41 100644 --- a/roojs-debug.js +++ b/roojs-debug.js @@ -11471,16 +11471,17 @@ Roo.CompositeElementLite.prototype.on = Roo.CompositeElementLite.prototype.addLi * @class Roo.data.Connection * @extends Roo.util.Observable * The class encapsulates a connection to the page's originating domain, allowing requests to be made - * either to a configured URL, or to a URL specified at request time.

- *

+ * either to a configured URL, or to a URL specified at request time. + * * Requests made by this class are asynchronous, and will return immediately. No data from * the server will be available to the statement immediately following the {@link #request} call. - * To process returned data, use a callback in the request options object, or an event listener.


- *

+ * To process returned data, use a callback in the request options object, or an event listener. + * * Note: If you are doing a file upload, you will not get a normal response object sent back to * your callback or event handler. Since the upload is handled via in IFRAME, there is no XMLHttpRequest. * The response object is created using the innerHTML of the IFRAME's document as the responseText - * property and, if present, the IFRAME's XML document as the responseXML property.


+ * property and, if present, the IFRAME's XML document as the responseXML property. + * * This means that a valid XML or HTML document must be returned. If JSON data is required, it is suggested * that it be placed either inside a <textarea> in an HTML document and retrieved from the responseText * using a regex, or inside a CDATA section in an XML document and retrieved from the responseXML using @@ -11612,6 +11613,11 @@ Roo.extend(Roo.data.Connection, Roo.util.Observable, { url = url || form.action; var enctype = form.getAttribute("enctype"); + + if (o.formData) { + return this.doFormDataUpload(o,p,url); + } + if(o.isUpload || (enctype && enctype.toLowerCase() == 'multipart/form-data')){ return this.doFormUpload(o, p, url); } @@ -11789,7 +11795,40 @@ Roo.extend(Roo.data.Connection, Roo.util.Observable, { form.removeChild(hiddens[i]); } } + }, + // this is a 'formdata version???' + + + doFormDataUpload : function(o, ps, url) + { + var form = Roo.getDom(o.form); + form.enctype = form.encoding = 'multipart/form-data'; + var formData = o.formData === true ? new FormData(form) : o.formData; + + var cb = { + success: this.handleResponse, + failure: this.handleFailure, + scope: this, + argument: {options: o}, + timeout : o.timeout || this.timeout + }; + + if(typeof o.autoAbort == 'boolean'){ // options gets top priority + if(o.autoAbort){ + this.abort(); + } + }else if(this.autoAbort !== false){ + this.abort(); + } + + //Roo.lib.Ajax.defaultPostHeader = null; + Roo.lib.Ajax.useDefaultHeader = false; + this.transId = Roo.lib.Ajax.request( "POST", url, cb, o.formData, o); + Roo.lib.Ajax.useDefaultHeader = true; + + } + }); /* * Based on: @@ -16380,7 +16419,7 @@ Roo.apply(Roo.XComponent, { break; default: - if (obj.disabled) { + if (obj.disabled || obj.region == '#disabled') { return; } break; @@ -16573,6 +16612,7 @@ Roo.apply(Roo.XComponent, { msg: msg, width:450, progress:true, + buttons : false, closable:false, modal: false @@ -23810,7 +23850,7 @@ Roo.extend(Roo.data.MemoryProxy, Roo.data.DataProxy, { params = params || {}; var result; try { - result = reader.readRecords(this.data); + result = reader.readRecords(params.data ? params.data :this.data); }catch(e){ this.fireEvent("loadexception", this, arg, null, e); callback.call(scope, null, arg, false); @@ -24549,24 +24589,31 @@ var myReader = new Roo.data.ArrayReader({ *

 [ [1, 'Bill', 'Gardener'], [2, 'Ben', 'Horticulturalist'] ]
   
- * @cfg {String} id (optional) The subscript within row Array that provides an ID for the Record + * @constructor * Create a new JsonReader * @param {Object} meta Metadata configuration options. - * @param {Object} recordType Either an Array of field definition objects + * @param {Object|Array} recordType Either an Array of field definition objects + * + * @cfg {Array} fields Array of field definition objects + * @cfg {String} id Name of the property within a row object that contains a record identifier value. * as specified to {@link Roo.data.Record#create}, * or an {@link Roo.data.Record} object + * + * * created using {@link Roo.data.Record#create}. */ Roo.data.ArrayReader = function(meta, recordType){ - Roo.data.ArrayReader.superclass.constructor.call(this, meta, recordType); + + + Roo.data.ArrayReader.superclass.constructor.call(this, meta, recordType||meta.fields); }; Roo.extend(Roo.data.ArrayReader, Roo.data.JsonReader, { /** * Create a data block containing Roo.data.Records from an XML document. * @param {Object} o An Array of row objects which represents the dataset. - * @return {Object} data A data block which is used by an Roo.data.Store object as + * @return {Object} A data block which is used by an {@link Roo.data.Store} object as * a cache of Roo.data.Records. */ readRecords : function(o){ @@ -24955,6 +25002,7 @@ Roo.extend(Roo.data.Node, Roo.util.Observable, { }else if(arguments.length > 1){ multi = arguments; } + // if passed an array or multiple args do them one by one if(multi){ for(var i = 0, len = multi.length; i < len; i++) { @@ -24973,6 +25021,7 @@ Roo.extend(Roo.data.Node, Roo.util.Observable, { } oldParent.removeChild(node); } + index = this.childNodes.length; if(index == 0){ this.setFirstChild(node); @@ -24990,6 +25039,9 @@ Roo.extend(Roo.data.Node, Roo.util.Observable, { this.setLastChild(node); node.setOwnerTree(this.getOwnerTree()); this.fireEvent("append", this.ownerTree, this, node, index); + if(this.ownerTree) { + this.ownerTree.fireEvent("appendnode", this, node, index); + } if(oldParent){ node.fireEvent("move", this.ownerTree, node, oldParent, this, index); } @@ -34227,7 +34279,15 @@ Roo.tree.TreePanel = function(el, config){ * * @param {Object} dragOverEvent */ - "nodedragover" : true + "nodedragover" : true, + /** + * @event appendnode + * Fires when append node to the tree + * @param {Roo.tree.TreePanel} this + * @param {Roo.tree.TreeNode} node + * @param {Number} index The index of the newly appended node + */ + "appendnode" : true }); if(this.singleExpand){ @@ -34805,7 +34865,7 @@ Roo.extend(Roo.tree.MultiSelectionModel, Roo.util.Observable, { * @cfg {Boolean} allowDrop false if this node cannot be drop on * @cfg {Boolean} disabled true to start the node disabled * @cfg {String} icon The path to an icon for the node. The preferred way to do this - * is to use the cls or iconCls attributes and add the icon via a CSS background image. + * is to use the cls or iconCls attributes and add the icon via a CSS background image. * @cfg {String} cls A css class to be added to the node * @cfg {String} iconCls A css class to be added to the nodes icon element for applying css background images * @cfg {String} href URL of the link used for the node (defaults to #) @@ -35088,7 +35148,8 @@ Roo.extend(Roo.tree.TreeNode, Roo.data.Node, { this.renderChildren(); } this.expanded = true; - if(!this.isHiddenRoot() && (this.getOwnerTree().animate && anim !== false) || anim){ + + if(!this.isHiddenRoot() && (this.getOwnerTree() && this.getOwnerTree().animate && anim !== false) || anim){ this.ui.animExpand(function(){ this.fireEvent("expand", this); if(typeof callback == "function"){ @@ -35539,7 +35600,7 @@ Roo.tree.TreeNodeUI.prototype = { this.addClass("x-tree-node-disabled"); } var ot = this.node.getOwnerTree(); - var dd = ot.enableDD || ot.enableDrag || ot.enableDrop; + var dd = ot ? (ot.enableDD || ot.enableDrag || ot.enableDrop) : false; if(dd && (!this.node.isRoot || ot.rootVisible)){ Roo.dd.Registry.register(this.elNode, { node: this.node, @@ -35782,11 +35843,11 @@ Roo.tree.TreeNodeUI.prototype = { // 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); + var txt = t && 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 tip = t && t.rendererTip ? t.rendererTip(n.attributes) : txt; var cb = typeof a.checked == 'boolean'; var href = a.href ? a.href : Roo.isGecko ? "" : "#"; var buf = ['
  • ', @@ -35972,7 +36033,9 @@ Roo.extend(Roo.tree.RootTreeNodeUI, Roo.tree.TreeNodeUI, { myTreeLoader.on("beforeload", function(treeLoader, node) { this.baseParams.category = node.attributes.category; }, this); -< + + + * * This would pass an HTTP parameter called "category" to the server containing * the value of the Node's "category" attribute. * @constructor @@ -37177,7 +37240,9 @@ Roo.extend(Roo.tree.ColumnTree, Roo.tree.TreePanel, { * @param {Object} config Configuration options */ Roo.menu.Menu = function(config){ - Roo.apply(this, config); + + Roo.menu.Menu.superclass.constructor.call(this, config); + this.id = this.id || Roo.id(); this.addEvents({ /** @@ -38658,6 +38723,69 @@ Roo.extend(Roo.menu.ColorMenu, Roo.menu.Menu);/* *