1. #1
    Sencha User
    Join Date
    Mar 2011
    Location
    Leicester
    Posts
    68
    Answers
    2
    Vote Rating
    0
    sadagopan is on a distinguished road

      0  

    Default Unanswered: Dynamically changing store proxy URL

    Unanswered: Dynamically changing store proxy URL


    Hi
    Is there any way to change the store Proxy URL dynamically with respect to the tap event ? I have to change the data according to the tap . The model and the store remains the same but the URL has to change .

  2. #2
    Touch Premium Member
    Join Date
    Jan 2012
    Location
    Houston, Texas
    Posts
    96
    Answers
    1
    Vote Rating
    1
    baushaug is on a distinguished road

      0  

    Default


    Sadagopan, you can use the getter/setter methods that are automatically generated for most config(s)

    I have to change the URL config for an AJAX proxy in an application I've implemented, like so:

    Code:
    try{
    
        var userid = sessionStorage.getItem("USERID"),
            list = Ext.getCmp('shoppinglist'),
            store = list.getStore(),
            rec = store.getAt(index);
    
    
        Ext.Ajax.request({
            url: 'http://mobilenew.brookshirebrothers.com/BBMobile.asmx/DeleteListItem',
            method: 'post',
            jsonData: { userid: userid, productid: rec.getData().PRODUCTID},
            headers: { 'Content-Type': 'application/json;charset=utf-8' },
            success: function (response, options) {
    
    
                shoplistobj = eval("(" + response.responseText + ")");
    
    
                if(shoplistobj.d.ITEMDELETED){
    
    
    
    
                    /*var lblCount = Ext.getCmp("lblSLCount");
                    lblCount.setHtml(shoplistobj.d.PRODUCTCOUNT);*/
                    console.log("label's html config set to " + shoplistobj.d.PRODUCTCOUNT);
    
    
                }
                else{
                    console.log("Item " + rec.getData().PRODUCTNAME +  " failed to delete!");
                }
    
    
            },
            failure: function (response, options) {
                console.log(response.responsText);
            }
        });
    
    
        //rebind shopping list
        var shoppinglist = Ext.getCmp('shoppinglist'),
            store = shoppinglist.getStore(),
            proxy = store.getProxy();
    
    
        proxy.setUrl('http://mobilenew.brookshirebrothers.com/datastore.aspx?action=shoppinglist&guid=' + userid);
        store.load();
    
    
    
    
    }
    catch(err){
        console.log(err);
    }

Thread Participants: 1

Tags for this Thread

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar