在商店中动态使用额外的参数 [英] use extra params in store dynamically

查看:19
本文介绍了在商店中动态使用额外的参数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个表格.在表单中,我使用带有 storecomboBox.

I have a form. In the form, I am using a comboBox with a store.

{
    xtype: 'combobox',
    id: 'SubContractor',
    name: 'SubContractor',
    fieldLabel: 'Sub Contractors',
    selectOnFocus: true,
    editable: false,
    displayField: 'FirstName',
    store: 'jsonGetSubContractorsList',
    typeAhead: true,
    allowBlank: false,
    typeAheadDelay: 20,
    valueField: 'SubContractID',
    width: 440,
    labelWidth: 229
}

在商店中,在代理中我有静态 extraParams,它正在工作.

In store, in proxy I have static extraParams, it's working.

proxy: {              
    type: 'ajax',
    url: '/admin/contract/subcontractors/jsonsubcontractorslist',
    extraParams: {
        cid : 34
    },
    reader: {
        type: 'json',
        root: 'data'
    }
},

但我不明白,如何将合同 ID 动态发送到我的商店.

But I don't get, how to send the contract ID to my store dynamically.

推荐答案

store.getProxy().extraParams = {
    foo: 'bar'
};
store.load();

这篇关于在商店中动态使用额外的参数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆