notes/brainstorming.txt
[app.Builder.js] / dbgenerate.js
index f25b515..5d2d001 100644 (file)
@@ -272,6 +272,8 @@ switch(cfg.DBTYPE) {
                 
                 
         break;
+    default:
+        throw "Invalid data base type " + cfg.DBTYPE + " should be MySQL or PostgreSQL";
 /*
            "Field": "province",
         "Type": "varchar(255)",
@@ -307,8 +309,8 @@ tables.forEach(function(table) {
     //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  = { }; 
@@ -385,6 +387,11 @@ tables.forEach(function(table) {
             '|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;
         }
@@ -619,7 +626,7 @@ readers.forEach(function(reader) {
                         "|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"
@@ -850,6 +857,7 @@ readers.forEach(function(reader) {
             "resizable": false,
             "title": "Edit / Create " + reader.table,
             "width": 400,
+            "modal" : true,
             "xtype": "LayoutDialog",
             "|xns": "Roo",
             "items": [