Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/extjs/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Extjs组合框不显示数据_Extjs_Combobox_Width - Fatal编程技术网

Extjs组合框不显示数据

Extjs组合框不显示数据,extjs,combobox,width,Extjs,Combobox,Width,我有一个编辑器网格面板,有两个字段。根据第一个字段,第二个字段应更改为带有更多选项的组合框。为此,需要在运行时获取第一个字段的值才能触发第二个字段的查询。 代码工作正常,正在检索数据。但即使第二个字段的宽度为350,出现的组合框也非常小,无法读取。甚至连下拉列表都看不到。我也尝试了ListWidth属性。。但产量没有变化 这是因为,最初combobox是空的,并且我正在使用beforequery属性更改带有id字段的url,所以combobox没有获取数据吗?但是我在firebug上看不到任何错

我有一个编辑器网格面板,有两个字段。根据第一个字段,第二个字段应更改为带有更多选项的组合框。为此,需要在运行时获取第一个字段的值才能触发第二个字段的查询。 代码工作正常,正在检索数据。但即使第二个字段的宽度为350,出现的组合框也非常小,无法读取。甚至连下拉列表都看不到。我也尝试了ListWidth属性。。但产量没有变化

这是因为,最初combobox是空的,并且我正在使用beforequery属性更改带有id字段的url,所以combobox没有获取数据吗?但是我在firebug上看不到任何错误

我有以下代码:

createGrid= function(e){
    var store= new Ext.data.Store({
        autoLoad: true,
        proxy: new Ext.data.HttpProxy({ url: ..... }) //url to get the data
        reader: new Ext.data.JsonReader({
            root: //the root,
            id: //id,
            sortInfo: {field: 'id', direction: 'ascending' },
            fields: ['id','fields']
        })
    });

    var store2= new Ext.data.store ({ 
        autoLoad: true,
        id: 'store2',
        proxy: new Ext.data.HttpProxy({ url: '  '}) //url 
        reader: new Ect.data.JsonReader({
            root: 'enums','id', fields: ['enum_id','value']
        })
    });


    var cm=new ext.grid.columnModel([
        {id:'id',name:'id',dataIndex: 'id', width: 300},
        {id:'fields', header: 'fields',width: 350, editor: new  Ext.form.ComboBox({
            name: 'combo',
            store: store2,
            width: 350,
            valueField: 'enum_id',
            displayField: 'value',
            listeners: {
                beforequery: function(query){
                    var g_n=Ext.getCmp('grid1');
                    var s_t=g_n.getSelectionModel().getSelections();
                    var record=s_t[0]; 
                    var assign_data=record.get('id');
                    var actionStore=Ext.StoreMgr.get('store2');
                    var action_combobox=Ext.getCmp('combo1');
                    actionStore.proxy.conn.url=' ',//new url which requires the 'id' field
                    actionStore.load();
                    return query;
                }
            }
        })},
    ]);


    return new Ext.grid.EditorGridPanel({
        id: 'grid1',
        store: store,
        cm:cm,
        sm: new Ext.grid.RowSelectionModel ({ singleSelect: true});
        autoExpandableColumn: 'fields',
        listeners: {
            //the other grid listeners
        }
    })
}
请帮我解决这个问题。 提前谢谢

 var store2 = new Ext.data.store(
可能需要用Ext.data.store或Ext.data.JsonStore替换Ext.data.store


也许您需要用Ext.data.store或Ext.data.JsonStore替换Ext.data.store

您使用的ExtJs版本是什么?另外,您在侦听器“beforequery”中使用的“combo1”表示的是哪个字段?作为随机检查,我希望在您的存储字段和来自服务器的JSON密钥中有匹配项。而且,一旦用户单击“字段”单元格,网格面板中的字段“字段”将被combobox替换。在firebug中,我可以看到检索到的值。firebug中没有显示任何错误。唯一的问题是,组合框的宽度非常小,而且下拉列表也没有显示。组合框的名称是“combo1”。。很抱歉代码部分的输入错误。在使用ExtJS和Ext.form.ComboBox宽度的UI中出现问题。有些是短的或长的,我们最终使用了[.我们不得不做一些调整,但是调整大小以适应列表中的内容效果很好,因为选项的长度不同。这里有一个更好的链接。您使用的ExtJs的版本是什么?另外,您在侦听器“beforequery”中使用的“combo1”代表了哪个字段?作为随机检查,我希望在您的存储区字段和来自服务器的JSON键中有一个匹配项。我正在使用extjs-3.3.1。而且,一旦用户单击“字段”单元格,网格面板中的字段“字段”将被combobox替换。在firebug中,我可以看到检索到的值。firebug中没有显示错误。唯一的问题是,combobox的宽度是非常小,也没有显示下拉列表。组合框的名称是“combo1”…很抱歉代码部分中的输入错误。在使用ExtJS的UI中出现问题,并且与Ext.form.combobox有关的宽度。一些是短的或长的,我们最终使用了[.我们不得不做一些调整,但是调整大小以适应列表中的内容效果很好,因为选项的长度不同。这里有一个更好的链接。