How can I change/add params on a store

后端 未结 4 658
萌比男神i
萌比男神i 2020-12-28 23:11

On a sencha-touch, here\'s is my store declaration

Ext.regStore(\'newsStore\',  {
    model: \'News\',
    autoLoad: true,
    proxy: {
        type: \'ajax\         


        
4条回答
  •  臣服心动
    2020-12-29 00:13

    Store declaration

    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);
            }
        }
    }   
    });
    

    Adding params to proxy and read ajax store

    prj.stores.contactInfoId.getProxy().extraParams.partyID = options.partyID;
    prj.stores.contactInfoId.getProxy().extraParams.eventName = options.eventName;
    prj.stores.contactInfoId.read();
    

    Hope this helps.

提交回复
热议问题