resources/Editors/Editor.Roo.GridPanel.bjs
[app.Builder.js] / resources / Editors / Editor.Roo.grid.Grid.js
index 54e3981..6ca394d 100644 (file)
@@ -222,41 +222,10 @@ Editor.Roo.grid.Grid = new Roo.XComponent({
        this.table = "XXX";
        this.firstTxtCol = "XXX";
       
-      
-       var map = {
-           'date' : 'date',
-           'datetime' : 'date',
-           'timestamp with time zone' : 'date',
-           'timestamp without time zone' : 'date',
-           'time' : 'string', //bogus
-           'int' : 'int',
-           'integer' : 'int',
-           'bigint' : 'int',
-           'double' : 'float',
-           'tinyint' : 'int',
-           'smallint' : 'int',
-           'decimal' : 'float',
-           'float' : 'float',
-           'numeric' : 'float',
-           'char' : 'string',
-           'character' : 'string',
-           'character varying' : 'string',
-           'varchar' : 'string',
-           'text' : 'string',
-           'longtext' : 'string',
-           'tinytext' : 'string',
-           'mediumtext' : 'string',
-           'enum' : 'string',
-           'timestamp' : 'number',
-           'blob' : 'text',
-           'bytea' : 'text',
-           'boolean' : 'int',
-           'text[]' : 'string',
-           
-       }
+       
        var jreader = {};
        var     colmodel = [];
-       this.grid.dataStore.each(function(rec) {
+       this.grid.dataSource.each(function(rec) {
            if (!rec.data.active) {
                return;
            }
@@ -266,9 +235,9 @@ Editor.Roo.grid.Grid = new Roo.XComponent({
            colmodel.push({
                "xtype": "ColumnModel",
                "header": rec.data.title,
-               "width":  row.data.width * 1,
-               "dataIndex": row.Field,
-               "|renderer": !row.Type.match(/date/i) ? 
+               "width":  rec.data.width * 1,
+               "dataIndex": rec.data.dataIndex,
+               "|renderer": !rec.data.type.match(/date/i) ? 
                        "function(v) { return String.format('{0}', v); }" :
                        "function(v) { return String.format('{0}', v ? v.format('d/M/Y') : ''); }" , // special for date
                "|xns": "Roo.grid",