resources/Editors/Editor.Roo.LayoutDialog.bjs
[app.Builder.js] / resources / Editors / Editor.Roo.LayoutDialog.js
index d2629aa..e263d60 100644 (file)
@@ -533,37 +533,30 @@ Editor.Roo.LayoutDialog = new Roo.XComponent({
            var r = data[k];
            var has_s = typeof(r.relates_to_schema) != 'undefined';
            
+           Roo.log(r.Type);
            var field_type = 'TextField';
            
+           if (r.Type == 'text'){
+               field_type = 'TextArea';
+           }
+           
+           if(r.Type == 'date' || r.Type == 'datetime'){
+               field_type = 'DateField';
+           }
+               
            var regex = /(.*?)\((.*?)\)/;
            
            if(regex.test(r.Type)){
                var type_match = regex.exec(r.Type);
                
-               switch type_match[1] {
-                   case 'varchar' :
-                       break;
-                   case 'int' :
+               if(type_match[1] == 'int'){
+                   field_type = 'NumberField';
                        
-                       field_type = 'NumberField';
-                       
-                       if(type_match[2] * 1  < 11){
-                           field_type = 'CheckBox';
-                       }
-                   
-               }
-               
-           } esle {
-               switch r.Type {
-                   case 'text' :
-                       field_type = 'TextArea';
-                       break;
-                   case 'date' :
-                   case 'datetime':
-                       field_type = 'DateField';
+                   if(type_match[2] * 1  < 11){
+                       field_type = 'CheckBox';
+                   }
                }
-           
-           }
+           } 
            
            var rt = '', rc = '', rs = [];
            
@@ -581,6 +574,10 @@ Editor.Roo.LayoutDialog = new Roo.XComponent({
                field_type = 'ComboBox';
            }
            
+           if(r.Field == 'id'){
+               field_type = 'Hidden';
+           }
+           
            
            
            var o = {
@@ -589,7 +586,7 @@ Editor.Roo.LayoutDialog = new Roo.XComponent({
                type : r.Type,
                title : r.Field,
                width : 200,
-               ftype : 'TextField',
+               ftype : field_type,
                display_field : rc, //r.Field + '_display_name',
                relates_to_table : rt,
                relates_to_col : rc,