如何在服务器请求中添加额外的参数?

时间:2014-04-17 13:55:40

标签: extjs extjs3

var SiteComboConfig = {
        fieldLabel: 'Site',
        xtype: 'combo',
        name: 'cloudsiteCombo',
        id: ' cloudsiteCombo',
        store: new Ext.data.JsonStore({
                autoDestroy: true,
                fields: [
                    {name: 'id', sortType: 'string'},
                    {name: 'name', sortType: 'string'}
                ],
                autoLoad: true,
                root: 'grid.items',
                url: CW.Context + '/ajax/Handler/getSites'
            }),
            tpl: '<tpl for="."><div ext:qtip="{name}" class="x-combo-list-item">{name:ellipsis(56, true)}</div></tpl>',
            allowBlank: false,
            preventMarkOnBlank: true,
            disableKeyFilter: true,
            editable: false,
            forceSelection: true,
            emptyText: 'Select a Site',
            valueField: 'id',
            displayField: 'name',
            mode: 'remote',
            triggerAction: 'all',
            hiddenName: 'cloudsite',
            onHide: function(){this.getEl().up('.x-form-item').setDisplayed(false);}, 
            onShow: function(){this.getEl().up('.x-form-item').setDisplayed(true);},
            // nominally, on change, we should populate the archive type pulldown with the known types for this server
            listeners: {
                'select': { // handle new site ID
                    fn: function(combo, record, index) {

                        combo.store.setBaseParam('evclocator', 'tpp'); 
                        combo.store.reload();

                        /*var siteID = combo.getValue();
                        params = {
                            siteID: siteID
                        };
                        Ext.Ajax.request({
                            url: 'ajax/Handler/getLicensedArchiveTypesForSite',
                            success: function(response, opts) {
                                var resp = Ext.decode(response.responseText);
                                this.updateSubTypeStore(resp.grid.items);                            
                            },
                            params: params,
                            scope: this
                        })*/
                    },

                    scope: this
                }
            }
        };

我想用组合ID发送其他值。 如何通过?

1 个答案:

答案 0 :(得分:0)

来自documentation

  

在现有的参数中添加新的参数:

lastOptions = myStore.lastOptions;
Ext.apply(lastOptions.params, {
    myNewParam: true
});
myStore.reload(lastOptions);