【问题标题】:ExtJS combobox not renderingExtJS 组合框不呈现
【发布时间】:2013-09-30 05:41:09
【问题描述】:

我有一个用于网格列的组合框编辑器。它也是可编辑的。组合框的存储有 autoLoad 配置,设置为 false 表示当用户单击组合框时,会加载存储。如果我不在组合框中输入任何内容并单击它,它就可以正常工作。但是,如果我先在组合框中键入内容,然后单击外部,然后再次单击组合框以加载下拉列表,则它根本不会呈现。它只显示加载,然后不显示下拉菜单。

这是一个非常奇怪的问题,因为我对其他列也有类似的组合框,它们工作正常,但它们不可编辑。

这和可编辑的配置有什么关系吗?

    var contextDropDownStoreforFactGrid = Ext.create('Ext.data.Store', {
    fields: [{name:'context',type:'string'}],
     proxy: {
         type: 'ajax',
         url: context + '/FcmServlet',
         extraParams: {
             'action': 'getContextDropDownValues'
         },
         reader: {
             type: 'json'
         }
     },
     autoLoad: false    /* load the store only when combo box is selected */
});

    editor: {
                xtype: 'combo',
                store: contextDropDownStoreforFactGrid,
                qureyMode: 'remote',
                id: 'fact_contextId',
                displayField:'context',
                valueField: 'context',
                vtype: 'alphanum',
                listeners: {
                    beforeQuery: function(query) {
                        if (contextDropDownStoreforFactGrid.getCount() != 0) {
                            contextDropDownStoreforFactGrid.removeAll();
                            contextDropDownStoreforFactGrid.load();
                        }

                    }
                }
            },
                renderer: function(value) {
                var index = contextDropDownStoreforFactGrid.find('context', value);
                if (index != -1) {
                    return contextDropDownStoreforFactGrid.getAt(index).data.context;             
                }
                return value;
            }

【问题讨论】:

  • 我已经添加了我的代码,即使我删除了渲染器它仍然有同样的问题。

标签: extjs combobox render extjs4.2


【解决方案1】:

您的组合框配置中有拼写错误:

qureyMode:“远程”,

应该是

queryMode:'远程',

这可能导致组合框无法从您的商店加载数据。

【讨论】:

  • 不,我修正了拼写并再次尝试,仍然是同样的问题
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2011-08-19
  • 1970-01-01
  • 2013-02-04
  • 1970-01-01
  • 2012-01-11
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多