X-Git-Url: http://git.roojs.org/?a=blobdiff_plain;f=roojs-debug.js;h=db55df5fec53b6c2c492a4057ab9617063db0ad6;hb=5a09638750d76b5c2f42753ab924401909761f61;hp=7fafc80751c6299c343e30e369edfa57b5543758;hpb=548db99acb22d3a26a190b77728b3b77575d93e1;p=roojs1 diff --git a/roojs-debug.js b/roojs-debug.js index 7fafc80751..db55df5fec 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]); + } /** @@ -58431,7 +58416,7 @@ Roo.extend(Roo.grid.ColumnModel, Roo.util.Observable, { /** - * Returns the column for a specified dataIndex. + * Returns the column Object for a specified dataIndex. * @param {String} dataIndex The column dataIndex * @return {Object|Boolean} the column or false if not found */ @@ -58757,7 +58742,35 @@ 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; + this.config[i] = c; + + 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)