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

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

问题描述

我有一张表格。在表单中,我使用 comboBox 商店



pre> 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 ,它的工作。

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

但是我没有得到,如何发送动态地存储我的商店的合同ID。

解决方案

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


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
}

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'
    }
},

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天全站免登陆