0
        xtype: 'combo',
        id: 'example',
        triggerAction:  'all',
        forceSelection: true,
        editable:       false,
        allowBlank: false,
        fieldLabel:     'example',
        mode: 'remote',
        displayField:'name',
        valueField: 'id',
        store: Ext.create('Ext.data.Store', {
                        fields: [
                            {name: 'id'},
                            {name: 'name'}
                        ],
                        //autoLoad: false,
                        proxy: {
                            type: 'ajax',
                            url: 'example.php',
                            reader: {
                                type: 'json',
                                root: 'rows'
                            }
                        }
            }
        })
        ,listeners: {
            render: function(combo) {
                combo.store().load(); // not working
            }
        }

如果我使用autoload: true那效果很好。但我想控制我的负载,我使用combo.store().load();Ext.getCmp('example').store.load();在渲染功能中或通过单击按钮。但一切都不起作用。

我该怎么做谢谢

4

1 回答 1

1

利用(component ref).getStore().load();

喜欢:

Ext.getCmp('example').getStore().load(); 
combo.getStore().load();
于 2013-07-08T08:37:32.197 回答