ExtJs 4.2:如何使用store.query呈现此组合框

ExtJs 4.2:如何使用store.query呈现此组合框,extjs,store,extjs4.2,Extjs,Store,Extjs4.2,我的应用程序是MVC 我有一个带列的网格,其中一列有一个带渲染器的网格。当用户单击其他网格时,此网格将打开 当我加载应用程序并单击打开此网格时,此列和之后的其他列不会加载。但是当我关闭并重新打开这个网格时,列被加载了。 我不知道问题在哪里,而且,这个问题没有出现在开发服务器上 我做了一个console.logExt.getStore'sTypesJours':我有一些记录 然后我做了一个console.logExt.getStore'sTypesJours'。查询'uid',val,false,

我的应用程序是MVC

我有一个带列的网格,其中一列有一个带渲染器的网格。当用户单击其他网格时,此网格将打开

当我加载应用程序并单击打开此网格时,此列和之后的其他列不会加载。但是当我关闭并重新打开这个网格时,列被加载了。 我不知道问题在哪里,而且,这个问题没有出现在开发服务器上

我做了一个console.logExt.getStore'sTypesJours':我有一些记录

然后我做了一个console.logExt.getStore'sTypesJours'。查询'uid',val,false,false,true:我第一次没有记录,但重新打开后它工作了

这是我的网格代码:

Ext.define('KGest.view.grille.Modif', {
    extend: 'Ext.grid.Panel',
    xtype: 'grillemodif',
    title: 'Elements déjà saisis',
    store: 'sGrilleModif',
    dockedItems: [
        {
            xtype: 'toolbar',
            dock: 'bottom',
            itemId: 'toptoolbarService',
            items: [
                {
                    xtype: 'button',
                    id: 'save-button-grillemodif',
                    text: 'Sauver les modifications',
                    iconCls: 'x-icon-save',
                    action: 'update',
                    dock: 'top',
                    scope: this
                }
            ]
        }
    ],
    selType: 'rowmodel',
    plugins: [
        Ext.create('Ext.grid.plugin.CellEditing', {
            clicksToEdit: 1
        })
    ],
    columnLines: true,
    viewConfig: {
        deferEmptyText: false,
        emptyText: 'Aucune donnée déjà saisie'
    },
    initComponent: function() {
        var me = this;

        me.selModel = Ext.create('Ext.selection.CheckboxModel', {
            listeners: {
                selectionchange: function(sm, selections) {
                    Ext.getCmp('validall-button-grillemodif').setDisabled(selections.length === 0);
                    Ext.getCmp('supprall-button-grillemodif').setDisabled(selections.length === 0);
                }
            },
            injectCheckbox: 7    // position de la colonne des checkbox
        });

        Ext.apply(me, {
            columns: [
                {
                    text: 'Journée',
                    dataIndex: 'journee',
                    allowBlank: false,
                    xtype: 'datecolumn',
                    format: 'd/m/Y',
                    width: 100,
                    editor: {
                        xtype: 'datefield',
                        submitFormat: 'Y-m-d'
                    }
                },
                {
                    text: 'Type de jour',
                    dataIndex: 'uid_types_saisies',
                    flex: 1,
                    editor: {
                        xtype: 'combobox',
                        store: Ext.create('KGest.store.sTypesJours'),
                        valueField: 'uid',
                        displayField: 'libelle',
                        typeAhead: true,
                        queryMode: 'remote',
                        emptyText: 'Sélectionnez un type de jour',
                        listeners: {
                            beforequery: function(queryEvent, eOpts) {
                                var tabFilter = new Array();
                                tabFilter[0] = {"property": "uid_salaries", "value": Ext.getCmp('uid_salaries').getValue()};
                                queryEvent.combo.store.proxy.extraParams.filter = JSON.stringify(tabFilter);
                            }
                        }
                    },
                    renderer: function(val) {
                        if (val > 0) {
                            var srvStore = Ext.getStore('sTypesJours');
                            detail = srvStore.query('uid', val, false, false, true);
                            sortie = detail.getAt(0).data.code;
                        }
                        return sortie;
                    }
                },
                {
                    text: '1/2<br/>jour',
                    dataIndex: 'demi_jour',
                    xtype: 'checkcolumn',
                    width: 50
                }
            ]
        });
        me.callParent(arguments);
    }
});

有人有什么想法吗?

在提出问题6个月后,我能提供的最好建议是:

时间就是一切,一个字段“renderer”在onload时间格式化单元格数据-同时,当存储阵列尚未填充时,实例化数据并将数据检索到renderer函数中的存储,返回未定义的结果,在下一次网格加载发生时,瞧,有填充的存储,您从查询中获得结果。。 可能很久以前就解决了这个问题,但是在调用布局/渲染器之前,在网格定义的范围外加载store autoload:true或实例化“store”