From 5a21fefafbb6d1d1a84e296fbd12eafb115760c2 Mon Sep 17 00:00:00 2001 From: Alan Knowles Date: Fri, 9 Jul 2021 13:47:24 +0800 Subject: [PATCH] sync --- buildSDK/dependancy_svg.txt | 2 + docs/json/roodata.json | 16 ++-- docs/src/Roo_grid_ColumnModel.js.html | 47 ++++++---- docs/src/Roo_svg_Canvas.js.html | 104 ++++++++++++++++++++++ docs/src/Roo_svg_Element.js.html | 116 +++++++++++++++++++++++++ docs/symbols/Roo.grid.ColumnModel.json | 21 +++++ docs/symbols/Roo.json | 33 ------- roojs-all.js | 8 +- roojs-bootstrap-debug.js | 47 ++++++---- roojs-bootstrap.js | 8 +- roojs-debug.js | 47 ++++++---- roojs-ui-debug.js | 47 ++++++---- roojs-ui.js | 8 +- 13 files changed, 379 insertions(+), 125 deletions(-) create mode 100644 buildSDK/dependancy_svg.txt create mode 100644 docs/src/Roo_svg_Canvas.js.html create mode 100644 docs/src/Roo_svg_Element.js.html diff --git a/buildSDK/dependancy_svg.txt b/buildSDK/dependancy_svg.txt new file mode 100644 index 0000000000..b3ba46ba3c --- /dev/null +++ b/buildSDK/dependancy_svg.txt @@ -0,0 +1,2 @@ +Roo.svg.Canvas +Roo.svg.Element \ No newline at end of file diff --git a/docs/json/roodata.json b/docs/json/roodata.json index 054a06ecda..bb52aa1754 100644 --- a/docs/json/roodata.json +++ b/docs/json/roodata.json @@ -379,14 +379,6 @@ "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
\nRoo.namespace('Company', 'Company.data');\nCompany.Widget = function() { ... }\nCompany.data.CustomStore = function(config) { ... }\n
", - "sig" : "(namespace1, namespace2, etc)", - "static" : true, - "memberOf" : "" - }, { "name" : "onReady", "type" : "function", @@ -97498,6 +97490,14 @@ } ], "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", diff --git a/docs/src/Roo_grid_ColumnModel.js.html b/docs/src/Roo_grid_ColumnModel.js.html index 6c3575aeae..9d78d67876 100644 --- a/docs/src/Roo_grid_ColumnModel.js.html +++ b/docs/src/Roo_grid_ColumnModel.js.html @@ -38,30 +38,15 @@ /** * 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]); + } /** @@ -529,7 +514,33 @@ */ 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) diff --git a/docs/src/Roo_svg_Canvas.js.html b/docs/src/Roo_svg_Canvas.js.html new file mode 100644 index 0000000000..f8979239e1 --- /dev/null +++ b/docs/src/Roo_svg_Canvas.js.html @@ -0,0 +1,104 @@ +Roo/svg/Canvas.js/** + * + * 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. + * + * + * + * + */ + +Roo.namespace('Roo.svg'); + +Roo.svg.Canvas = function(cfg) +{ + Roo.svg.Canvas.superclass.constructor.call(this, cfg); + this.addEvents({ + 'click' : true, + 'dblclick' : true, + 'context' : true + }); + +} + +Roo.extend(Roo.svg.Canvas, Roo.bootstrap.Component, { + + + + getAutoCreate : function(){ + + + return { + ns: "svg", + xmlns: "http://www.w3.org/2000/svg", + tag: "svg", + width: 100, + height: 100, + cn : [ + { + ns: "svg", + tag: "g", + focusable : 'true' + } + ] + }; + }, + + initEvents: function() + { + Roo.svg.Canvas.superclass.initEvents.call(this); + // others... + + this.el.on('click', this.relayEvent, this); + this.el.on('dblclick', this.relayEvent, this); + this.el.on('context', this.relayEvent, this); // ??? any others + this.g = this.el.select('g', true).first(); + + + }, + + relayEvent: function(e) + { + //e.type + var cel = e.getTarget('.roo-svg-observable', false, true); + if (!cel || typeof(cel.listeners[e.type]) == 'undefined') { + this.fireEvent(e.type); + return; + } + cel.listeners[e.type].fire(e, cel); + + }, + + + fitToParent : function() + { + // should it fit Horizontal - as per this? + // or fit full ? // in which case pan/zoom done by drag? + + if (!this.el.dom.parentNode) { // check if this Element still exists + return; + } + (function() { + var p = Roo.get(this.el.dom.parentNode); + var gs = this.g.dom.getBBox(); + var ratio = gs.height / gs.width; + ratio = isNaN(ratio) || ratio < 0.2 ? 1 : ratio; + var x = p.getComputedWidth() - p.getFrameWidth('lr') - 20; // close as possible with scroll bar + this.el.attr({ + width : x, + height : x * ratio //p.getComputedHeight() - p.getFrameWidth('tb') + }); + if (gs.height) { + this.el.attr("viewBox", gs.x + " " + gs.y + " " + gs.width + " " + gs.height); + } + + }).defer(300, this); + + } + + + +}); \ 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 index 0000000000..650ab9bf1a --- /dev/null +++ b/docs/src/Roo_svg_Element.js.html @@ -0,0 +1,116 @@ +Roo/svg/Element.js/** + * + * 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. + * + * + * + */ + +Roo.namespace('Roo.svg'); + +Roo.svg.Element = function(cfg) +{ + Roo.svg.Element.superclass.constructor.call(this, cfg); + this.addEvents({ + 'click' : true, + 'dblclick' : true, + 'context' : true + }); + +} + +Roo.extend(Roo.svg.Element, Roo.Component, { + + tag : 'g', + + cls : '', + + getAutoCreate : function(){ + + + return { + ns: "svg", + xmlns: "http://www.w3.org/2000/svg", + tag: this.tag, + cls : this.cls + ' roo-svg-observable' + }; + }, + + initEvents: function() + { + Roo.svg.Canvas.superclass.initEvents.call(this); + // others... + this.el.relayEvent('click', this); + this.el.relayEvent('dblclick', this); + this.el.relayEvent('context', this); + + }, + + // private + onRender : function(ct, position) + { + // Roo.log("Call onRender: " + this.xtype); + + Roo.bootstrap.Component.superclass.onRender.call(this, ct, position); + + if(this.el){ + if (this.el.attr('xtype')) { + this.el.attr('xtypex', this.el.attr('xtype')); + this.el.dom.removeAttribute('xtype'); + + this.initEvents(); + } + + return; + } + + + + var cfg = Roo.apply({}, this.getAutoCreate()); + + cfg.id = this.id || Roo.id(); + + // fill in the extra attributes + if (this.xattr && typeof(this.xattr) =='object') { + for (var i in this.xattr) { + cfg[i] = this.xattr[i]; + } + } + + if(this.dataId){ + cfg.dataId = this.dataId; + } + + if (this.cls) { + cfg.cls = (typeof(cfg.cls) == 'undefined') ? this.cls : cfg.cls + ' ' + this.cls; + } + + if (this.style) { // fixme needs to support more complex style data. + cfg.style = this.style; + } + + if(this.name){ + cfg.name = this.name; + } + + this.el = ct.createChild(cfg, position); + + if (this.tooltip) { + this.tooltipEl().attr('tooltip', this.tooltip); + } + + if(this.tabIndex !== undefined){ + this.el.dom.setAttribute('tabIndex', this.tabIndex); + } + + this.initEvents(); + + } + + + +}); \ No newline at end of file diff --git a/docs/symbols/Roo.grid.ColumnModel.json b/docs/symbols/Roo.grid.ColumnModel.json index 8a469c35d0..544db99abf 100644 --- a/docs/symbols/Roo.grid.ColumnModel.json +++ b/docs/symbols/Roo.grid.ColumnModel.json @@ -258,6 +258,27 @@ } ] }, + { + "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.", diff --git a/docs/symbols/Roo.json b/docs/symbols/Roo.json index 4c5c71ba38..b3f20f6a3b 100644 --- a/docs/symbols/Roo.json +++ b/docs/symbols/Roo.json @@ -656,39 +656,6 @@ ], "returns" : [] }, - { - "name" : "namespace", - "desc" : "Creates namespaces to be used for scoping variables and classes so that they are not global. Usage:\n
\nRoo.namespace('Company', 'Company.data');\nCompany.Widget = function() { ... }\nCompany.data.CustomStore = function(config) { ... }\n
", - "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:
\nRoo.override(MyClass, {\n    newMethod1: function(){\n        // etc.\n    },\n    newMethod2: function(foo){\n        // etc.\n    }\n});\n 
", diff --git a/roojs-all.js b/roojs-all.js index 47a0b4a7f4..87c9b8b501 100644 --- a/roojs-all.js +++ b/roojs-all.js @@ -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-1?this.config[B]:false;},getIndexById:function(id){for(var i=0,A=this.config.length;i=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 " "; -}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 " ";}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;}}); diff --git a/roojs-bootstrap-debug.js b/roojs-bootstrap-debug.js index 9e4fb24682..6e7806c166 100644 --- a/roojs-bootstrap-debug.js +++ b/roojs-bootstrap-debug.js @@ -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) diff --git a/roojs-bootstrap.js b/roojs-bootstrap.js index ee6d637b53..7dfc3e5c1b 100644 --- a/roojs-bootstrap.js +++ b/roojs-bootstrap.js @@ -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-1?this.config[B]:false;},getIndexById:function(id){for(var i=0,A=this.config.length;i=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 " "; -}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 " ";}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; diff --git a/roojs-debug.js b/roojs-debug.js index 7fafc80751..59a70f4fcf 100644 --- a/roojs-debug.js +++ b/roojs-debug.js @@ -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) diff --git a/roojs-ui-debug.js b/roojs-ui-debug.js index 97097444c3..91439dc22e 100644 --- a/roojs-ui-debug.js +++ b/roojs-ui-debug.js @@ -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) diff --git a/roojs-ui.js b/roojs-ui.js index 668c18211d..fc1df661d2 100644 --- a/roojs-ui.js +++ b/roojs-ui.js @@ -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-1?this.config[B]:false;},getIndexById:function(id){for(var i=0,A=this.config.length;i=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 " "; -}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 " ";}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;}}); -- 2.39.2