sencha-touch - 如何在商店中更改/添加参数

标签 sencha-touch extjs

在 sencha-touch 上,这是我的商店声明

Ext.regStore('newsStore',  {
    model: 'News',
    autoLoad: true,
    proxy: {
        type: 'ajax',
        url: '../news/list.form?format=json',
        reader: {
            type: 'json',
            root: ''
        }
    },                        
});

如何修改参数?我试过
params:{ format: 'json'}

但它不起作用!

最佳答案

店铺声明

new Ext.data.Store({
model:'prj.models.ContactInfo',
storeId:'contactInfoId',
proxy:{
    type:'ajax',
    url:'/GetContactInfoByID',
    reader:{
        type:'json'
    },
    extraParams:{
        format:'json'
    },
    listeners:{
        exception:function(proxy, response, orientation){
            console.error('Failure Notification', response.responseText);
            Ext.Msg.alert('Loading failed', response.statusText);
        }
    }
}   
});

将参数添加到代理和读取 ajax 存储
prj.stores.contactInfoId.getProxy().extraParams.partyID = options.partyID;
prj.stores.contactInfoId.getProxy().extraParams.eventName = options.eventName;
prj.stores.contactInfoId.read();

希望这可以帮助。

关于sencha-touch - 如何在商店中更改/添加参数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6120713/

相关文章:

list - 如何设置行高 Sencha Touch List

android - 在 Android 混合应用中使用 Pdf.js 加载本地文件

facebook - Facebook iFrame 中的 Sencha 应用程序获得 "Cannot POST/"

extjs - 如何在 Extjs View 中引用两个同名商店之一?

javascript - extjs4 在 Controller 中获取 View 实例?

facebook - 如何在 extJS 3.4 中设计薄滚动条,如 facebook 提供的列表和聊天

sencha-touch - sencha touch 2 中的模态视图

javascript - ExtJS 4 中函数处理程序内的作用域

extjs - 商店加载在 30 秒后取消

android - 如何更改 PushNotification 的消息内容?