resources/Editors/Editor.Roo.LayoutDialog.bjs
[app.Builder.js] / resources / Editors / Editor.Roo.LayoutDialog.js
index e904513..b02dbb7 100644 (file)
@@ -342,7 +342,7 @@ Editor.Roo.LayoutDialog = new Roo.XComponent({
           '|xns' : 'Roo.data',
           data : [ 
               [ 'ComboBox', "ComboBox"],
-              [ 'ComboBoxArray', "ComboBoxArray"] 
+              [ 'ComboBoxArray', "ComboBoxArray"],
               [ 'TextField' , "TextField"],
               [ 'NumberField', "NumberField"],
               [ 'TextArea', "TextArea"],
@@ -527,7 +527,6 @@ Editor.Roo.LayoutDialog = new Roo.XComponent({
    
        var fields = _this.grid.dataSource.reader.recordType.prototype.fields;
        
-       
        var d = [];
    
        for (var k in data) { 
@@ -554,7 +553,7 @@ Editor.Roo.LayoutDialog = new Roo.XComponent({
                    field_type = 'NumberField';
                        
                    if(type_match[2] * 1  < 11){
-                       field_type = 'CheckBox';
+                       field_type = 'Checkbox';
                    }
                }
            } 
@@ -667,8 +666,10 @@ Editor.Roo.LayoutDialog = new Roo.XComponent({
                el.alwaysQuery = true;
                el.triggerAction = 'all';
                el.forceSelection = true;
+               el.selectOnFocus = true;
                el.minChars = 2;
                el.editable = true;
+               el.emptyText = 'Select a value';
                
                
                el.queryParam  = 'query[' + rec.data.display_field + ']';// SET WHEN USED
@@ -729,54 +730,57 @@ Editor.Roo.LayoutDialog = new Roo.XComponent({
                
                el.items = [
                    {
-                       '*prop' : 'store',
-                       'xtype' : 'Store',
-                       '|xns' : 'Roo.data',
-                       'remoteSort' : true,
-                       '|sortInfo' : '{ direction : \'ASC\', field: \'id\' }',
-                       listeners : {
-                           '|beforeload' : 'function (_self, o)' +
-                           "{\n" +
-                           "    o.params = o.params || {};\n" +
-                           "    // set more here\n" +
-                           "}\n"
-                       },
+                       'alwaysQuery' : true,
+                       'triggerAction' : 'all',
+                       'forceSelection': true,
+                       'selectOnFocus' : true,
+                       'minChars' :2,
+                       'editable' : true,
+                       'emptyText' : 'Select a value',
+                       'displayField' : rec.data.display_field,
+                       'valueField' : rec.data.relates_to_col,
+                       'xtype' : 'ComboBox',
+                       '$ xns' : 'Roo.form',
+                       '* prop' : 'combo',
+                       'queryParam' : 'query[' + rec.data.display_field + ']',
+                       'tpl' : '<div class="x-grid-cell-text x-btn button"><b>{' + rec.data.display_field +'}</b> </div>',
+                       
                        items : [
                            {
-                               '*prop' : 'proxy',
-                               'xtype' : 'HttpProxy',
-                               'method' : 'GET',
-                               '|xns' : 'Roo.data',
-                               '|url' : "baseURL + '/Roo/" + rec.data.relates_to_table + ".php'",
-                           },
-                           
-                           {
-                               '*prop' : 'reader',
-                               'xtype' : 'JsonReader',
+                               '*prop' : 'store',
+                               'xtype' : 'Store',
                                '|xns' : 'Roo.data',
-                               'id' : 'id',
-                               'root' : 'data',
-                               'totalProperty' : 'total'
-   
+                               'remoteSort' : true,
+                               '|sortInfo' : '{ direction : \'ASC\', field: \'id\' }',
+                               listeners : {
+                                   '|beforeload' : 'function (_self, o)' +
+                                   "{\n" +
+                                   "    o.params = o.params || {};\n" +
+                                   "    // set more here\n" +
+                                   "}\n"
+                               },
+                               items : [
+                                   {
+                                       '*prop' : 'proxy',
+                                       'xtype' : 'HttpProxy',
+                                       'method' : 'GET',
+                                       '|xns' : 'Roo.data',
+                                       '|url' : "baseURL + '/Roo/" + rec.data.relates_to_table + ".php'",
+                                   },
+                                   {
+                                       '*prop' : 'reader',
+                                       'xtype' : 'JsonReader',
+                                       '|xns' : 'Roo.data',
+                                       'id' : 'id',
+                                       'root' : 'data',
+                                       'totalProperty' : 'total'
+                                   }
                                
+                               ]
                            }
                        ]
                    }
                ];
-               
-               el.queryParam  = 'query[' + rec.data.display_field + ']';// SET WHEN USED
-               
-               el.hiddenName = rec.data.dataIndex // SET WHEN USED eg. project_id
-               el.name  = rec.data.dataIndex + '_' + rec.data.display_field; // SET WHEN USED eg. project_id_name
-               
-               el.displayField = rec.data.display_field // SET WHEN USED eg. project_id
-               el.valueField = rec.data.relates_to_col 
-               
-               el.tpl = '<div class="x-grid-cell-text x-btn button"><b>{' + rec.data.display_field +'}</b> </div>'; // SET WHEN USED
-             
-           
-              
-           
            }
            
            if (el.xtype == 'HtmlEditor') {