'date' : 'date',
'datetime' : 'date',
'timestamp with time zone' : 'date',
+ 'timestamp without time zone' : 'date',
'time' : 'string', //bogus
'int' : 'int',
'integer' : 'int',
'numeric' : 'float',
'char' : 'string',
'character' : 'string',
+ 'character varying' : 'string',
'varchar' : 'string',
'text' : 'string',
'longtext' : 'string',
'enum' : 'string',
'timestamp' : 'number',
'blob' : 'text',
+ 'bytea' : 'text',
'boolean' : 'int',
+ 'text[]' : 'string',
}
break;
+ default:
+ throw "Invalid data base type " + cfg.DBTYPE + " should be MySQL or PostgreSQL";
/*
"Field": "province",
"Type": "varchar(255)",
//print(JSON.stringify(schema, null,4)); Seed.quit();
schema.forEach(function(e) {
- e.Type = e.type;
- e.Field = e.field;
+ e.Type = e.Type || e.type;
+ e.Field = e.Field || e.field;
var type = e.Type.match(/([^(]+)\(([^\)]+)\)/);
var row = { };
'|xns' : 'Roo.form',
xtype : xtype
}
+ if (xtype == 'DateField') {
+ form[row.name].format = 'Y-m-d';
+ form[row.name].width = 100;
+ }
+
if (xtype == 'TextArea') {
form[row.name].height = 100;
}
var combo = {
'|xns' : 'Roo.form',
xtype: 'ComboBox',
- allowBlank : 'false',
- editable : 'false',
+ allowBlank : false,
+ editable : false,
emptyText : 'Select ' + table,
forceSelection : true,
listWidth : 400,
"|rowdblclick": "function (_self, rowIndex, e)\n" +
"{\n" +
" if (!_this.dialog) return;\n" +
- " _this.dialog.show( this.getDataSource().getAt(rowIndex), function() {\n" +
+ " _this.dialog.show( this.getDataSource().getAt(rowIndex).data, function() {\n" +
" _this.grid.footer.onClick('first');\n" +
" }); \n" +
"}\n"
"resizable": false,
"title": "Edit / Create " + reader.table,
"width": 400,
+ "modal" : true,
"xtype": "LayoutDialog",
"|xns": "Roo",
"items": [