X-Git-Url: http://git.roojs.org/?a=blobdiff_plain;f=resources%2FEditors%2FEditor.Roo.LayoutDialog.js;h=d2629aa39d36fb056777692a8d795e7917446243;hb=1be141aa5ec3768dca510628250ba1603a7d5d10;hp=f1a6504a068b13297370ccf711b84c8092168526;hpb=5b207aa552ea8b0e6afd1cfcde68f521465517db;p=app.Builder.js diff --git a/resources/Editors/Editor.Roo.LayoutDialog.js b/resources/Editors/Editor.Roo.LayoutDialog.js index f1a6504a0..d2629aa39 100644 --- a/resources/Editors/Editor.Roo.LayoutDialog.js +++ b/resources/Editors/Editor.Roo.LayoutDialog.js @@ -533,6 +533,38 @@ Editor.Roo.LayoutDialog = new Roo.XComponent({ var r = data[k]; var has_s = typeof(r.relates_to_schema) != 'undefined'; + var field_type = 'TextField'; + + var regex = /(.*?)\((.*?)\)/; + + if(regex.test(r.Type)){ + var type_match = regex.exec(r.Type); + + switch type_match[1] { + case 'varchar' : + break; + case 'int' : + + 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'; + } + + } + var rt = '', rc = '', rs = []; if(has_s){ @@ -545,19 +577,10 @@ Editor.Roo.LayoutDialog = new Roo.XComponent({ rs.push([rr.Field]); } + + field_type = 'ComboBox'; } - var regex = /(.*?)\((.*?)\)/; - - if(regex.test(r.Type)){ - - } - - var type_match = regex.exec(r.Type); - - Roo.log(type_match); - - var o = {