X-Git-Url: http://git.roojs.org/?a=blobdiff_plain;f=roojs-ui-debug.js;h=97097444c3c14f7a5bda82ecfe7b8b39df6d8fb1;hb=8946284bad10596673ce59afe8ef1ea49ba0b790;hp=5f0b4e6301bf6bdf4f26c91a1df202c63e4c78bc;hpb=41a76ad00f5fc61e2452862ddf6908ae45d7fd73;p=roojs1 diff --git a/roojs-ui-debug.js b/roojs-ui-debug.js index 5f0b4e6301..97097444c3 100644 --- a/roojs-ui-debug.js +++ b/roojs-ui-debug.js @@ -2197,35 +2197,35 @@ Roo.extend(Roo.data.ArrayReader, Roo.data.JsonReader, { readRecords : function(o) { var sid = this.meta ? this.meta.id : null; - var recordType = this.recordType, fields = recordType.prototype.fields; - var records = []; - var root = o; - for(var i = 0; i < root.length; i++){ - var n = root[i]; - var values = {}; - var id = ((sid || sid === 0) && n[sid] !== undefined && n[sid] !== "" ? n[sid] : null); - for(var j = 0, jlen = fields.length; j < jlen; j++){ - var f = fields.items[j]; - var k = f.mapping !== undefined && f.mapping !== null ? f.mapping : j; - var v = n[k] !== undefined ? n[k] : f.defaultValue; - v = f.convert(v); - values[f.name] = v; - } - var record = new recordType(values, id); - record.json = n; - records[records.length] = record; - } - return { - records : records, - totalRecords : records.length - }; + var recordType = this.recordType, fields = recordType.prototype.fields; + var records = []; + var root = o; + for(var i = 0; i < root.length; i++){ + var n = root[i]; + var values = {}; + var id = ((sid || sid === 0) && n[sid] !== undefined && n[sid] !== "" ? n[sid] : null); + for(var j = 0, jlen = fields.length; j < jlen; j++){ + var f = fields.items[j]; + var k = f.mapping !== undefined && f.mapping !== null ? f.mapping : j; + var v = n[k] !== undefined ? n[k] : f.defaultValue; + v = f.convert(v); + values[f.name] = v; + } + var record = new recordType(values, id); + record.json = n; + records[records.length] = record; + } + return { + records : records, + totalRecords : records.length + }; }, // used when loading children.. @see loadDataFromChildren toLoadData: function(rec) { - // expect rec just to be an array.. eg [a,b,c, [...] << cn ] - return typeof(rec.data.cn) == 'undefined' ? [] : rec.data.cn; - + // expect rec just to be an array.. eg [a,b,c, [...] << cn ] + return typeof(rec.data.cn) == 'undefined' ? [] : rec.data.cn; + } @@ -15346,7 +15346,7 @@ Roo.menu.TextItem = function(cfg){ Roo.extend(Roo.menu.TextItem, Roo.menu.BaseItem, { /** - * @cfg {Boolean} text Text to show on item. + * @cfg {String} text Text to show on item. */ text : '', @@ -20653,10 +20653,11 @@ Roo.extend(Roo.HtmlEditorCore, Roo.Component, { st = ''; - } else { - st = ''; + } else { + for (var i in this.stylesheets) { + st += ''; + } + } st += '' + - ' '; + ' '; }, // private @@ -21582,6 +21583,9 @@ Roo.extend(Roo.HtmlEditorCore, Roo.Component, { if (v.match(/^#/)) { return; } + if (v.match(/^\{/)) { // allow template editing. + return; + } // Roo.log("(REMOVE TAG)"+ node.tagName +'.' + n + '=' + v); node.removeAttribute(n); @@ -22215,8 +22219,8 @@ Roo.HtmlEditorCore.cblack= [ Roo.HtmlEditorCore.swapCodes =[ - [ 8211, "--" ], - [ 8212, "--" ], + [ 8211, "–" ], + [ 8212, "—" ], [ 8216, "'" ], [ 8217, "'" ], [ 8220, '"' ], @@ -24595,7 +24599,26 @@ Roo.extend(Roo.form.BasicForm, Roo.util.Observable, { return valid; }, - + /** + * Returns array of invalid form fields. + * @return Array + */ + + invalidFields : function() + { + var ret = []; + this.items.each(function(f){ + if(f.validate()){ + return; + } + ret.push(f); + + }); + + return ret; + }, + + /** * DEPRICATED Returns true if any fields in this form have changed since their original load. * @return Boolean @@ -28443,10 +28466,10 @@ Roo.DDView = function(container, tpl, config) { this.getEl().setStyle("outline", "0px none"); this.getEl().unselectable(); if (this.dragGroup) { - this.setDraggable(this.dragGroup.split(",")); + this.setDraggable(this.dragGroup.split(",")); } if (this.dropGroup) { - this.setDroppable(this.dropGroup.split(",")); + this.setDroppable(this.dropGroup.split(",")); } if (this.deletable) { this.setDeletable(); @@ -31189,6 +31212,7 @@ Roo.LayoutStateManager.prototype = { * @cfg {String/Object} params When used with {@link #url}, calls {@link #setUrl} with this value * @cfg {Boolean} loadOnce When used with {@link #url}, calls {@link #setUrl} with this value * @cfg {String} content Raw content to fill content panel with (uses setContent on construction.) + * @cfg {String} style Extra style to add to the content panel * @constructor * Create a new ContentPanel. @@ -31226,6 +31250,8 @@ Roo.ContentPanel = function(el, config, content){ {tag: "div", cls: "x-layout-inactive-content", id: config.id||el}, true); } } + + this.closable = false; this.loaded = false; this.active = false; @@ -32377,6 +32403,9 @@ Roo.extend(Roo.grid.Grid, Roo.util.Observable, { /** * @cfg {String} ddGroup - drag drop group. */ + /** + * @cfg {String} dragGroup - drag group (?? not sure if needed.) + */ /** * @cfg {Number} minColumnWidth The minimum width a column can be resized to. Default is 25. @@ -32413,6 +32442,9 @@ Roo.extend(Roo.grid.Grid, Roo.util.Observable, { /** * @cfg {Boolean} enableDrag True to enable drag of rows. Default is false. (double check if this is needed?) + */ + /** + * @cfg {Boolean} enableDrop True to enable drop of elements. Default is false. (double check if this is needed?) */ /** @@ -32487,6 +32519,15 @@ Roo.extend(Roo.grid.Grid, Roo.util.Observable, { /** * @cfg {Number} maxHeight Sets the maximum height of the grid - ignored if autoHeight is not on. */ + + + /** + * @cfg {String} ddText Configures the text is the drag proxy (defaults to "%0 selected row(s)"). + * %0 is replaced with the number of selected rows. + */ + ddText : "{0} selected row{1}", + + /** * Called once after all setup has been completed and the grid is ready to be rendered. * @return {Roo.grid.Grid} this @@ -32797,11 +32838,17 @@ Roo.extend(Roo.grid.Grid, Roo.util.Observable, { getView : function(){ if(!this.view){ this.view = new Roo.grid.GridView(this.viewConfig); + this.relayEvents(this.view, [ + "beforerowremoved", "beforerowsinserted", + "beforerefresh", "rowremoved", + "rowsinserted", "rowupdated" ,"refresh" + ]); } return this.view; }, /** * Called to get grid's drag proxy text, by default returns this.ddText. + * Override this to put something different in the dragged text. * @return {String} */ getDragDropText : function(){ @@ -32809,12 +32856,7 @@ Roo.extend(Roo.grid.Grid, Roo.util.Observable, { return String.format(this.ddText, count, count == 1 ? '' : 's'); } }); -/** - * Configures the text is the drag proxy (defaults to "%0 selected row(s)"). - * %0 is replaced with the number of selected rows. - * @type String - */ -Roo.grid.Grid.prototype.ddText = "{0} selected row{1}";/* +/* * Based on: * Ext JS Library 1.1.1 * Copyright(c) 2006-2007, Ext JS, LLC. @@ -33729,7 +33771,7 @@ Roo.extend(Roo.grid.GridView, Roo.grid.AbstractGridView, { ); */ if(ctop < stop){ - c.scrollTop = ctop; + c.scrollTop = ctop; //Roo.log("set scrolltop to ctop DISABLE?"); }else if(cbot > sbot){ //Roo.log("set scrolltop to cbot-ch"); @@ -34724,7 +34766,8 @@ Roo.extend(Roo.grid.GridView, Roo.grid.AbstractGridView, { } }, - layout : function(initialRender, is2ndPass){ + layout : function(initialRender, is2ndPass) + { var g = this.grid; var auto = g.autoHeight; var scrollOffset = 16; @@ -34983,7 +35026,12 @@ Roo.extend(Roo.grid.GridDragZone, Roo.dd.DragZone, { } } + if (sm.getSelections && sm.getSelections().length < 1) { + return false; + } + + // before it used to all dragging of unseleted... - now we dont do that. if(rowIndex !== false){ // if editorgrid.. @@ -35004,14 +35052,14 @@ Roo.extend(Roo.grid.GridDragZone, Roo.dd.DragZone, { grid: this.grid, ddel: this.ddel, rowIndex: rowIndex, - selections:sm.getSelections ? sm.getSelections() : ( - sm.getSelectedCell() ? [ this.grid.ds.getAt(sm.getSelectedCell()[0]) ] : [] - ) + selections: sm.getSelections ? sm.getSelections() : ( + sm.getSelectedCell() ? [ this.grid.ds.getAt(sm.getSelectedCell()[0]) ] : []) }; } return false; }, - + + onInitDrag : function(e){ var data = this.dragData; this.ddel.innerHTML = this.grid.getDragDropText();