Gelmiş geçmiş en büyük porno sitemiz olan 2pe de her zaman en kaliteli pornoları sunmayı hedefledik. Diğer video sitemiz olan vuam da ise hd porno ağırlıklı çalışmalara başladık.

  1. #1
    Sencha Premium Member
    Join Date
    Jul 2012
    Posts
    12
    Vote Rating
    0
    PJoe is on a distinguished road

      0  

    Default Unanswered: Usage of store/proxy in offline mode

    Unanswered: Usage of store/proxy in offline mode


    I have been using store/model/proxy to fetch data from the server - this works fine.
    My requirement is to store this data in a sqllite database on the device for offline use. Currently my store/proxy is configured to fetch/send data to from/to a server. How can I use the same to store/fetch data from the local sqllite database in offline mode? Do I have to define a new set of models/stores?
    Can anyone please provide some pointers as I am trying to absorb the "offline" mode.

    Thanks.

  2. #2
    Sencha User jerome76's Avatar
    Join Date
    Apr 2012
    Location
    New Jersey
    Posts
    1,149
    Answers
    132
    Vote Rating
    99
    jerome76 is just really nice jerome76 is just really nice jerome76 is just really nice jerome76 is just really nice jerome76 is just really nice

      0  

    Default


    You will have to change the Store's Proxy. Also, if the SQL database uses different parameters and fields then you will have to change the Model as well. The Store has methods to do that.

    In my opinion, I would use the same Store if it involves the same set of data (as in the same Model).

  3. #3
    Sencha Premium Member
    Join Date
    Jul 2012
    Posts
    12
    Vote Rating
    0
    PJoe is on a distinguished road

      0  

    Default


    So I guess you are suggesting the use the same store and could this be done something like this?
    If (connected)
    {
    myStore.setProxy(OnLineServerDetails)
    }
    else
    {
    myStore.setProxy(LocalStorageProxy)
    }

    Does any one has success stories in using the same stores/models this way? Can you share any code samples?

  4. #4
    Sencha User jerome76's Avatar
    Join Date
    Apr 2012
    Location
    New Jersey
    Posts
    1,149
    Answers
    132
    Vote Rating
    99
    jerome76 is just really nice jerome76 is just really nice jerome76 is just really nice jerome76 is just really nice jerome76 is just really nice

      0  

    Default


    You can do something like this:
    Code:
    var onlineProxy = {
    	//online configs
    };
    var offlineProxy = {
    	//offline configs
    };
    Ext.create('Ext.data.Store', {
    	storeId: 'datastore',
    	proxy: connected ? onlineProxy : offlineProxy,
    	model: connected ? 'onlineModel' : 'offlineModel', //if necessary
    	autoLoad: false, 
    	listeners: {
    		load: function(store, records) {
    			//do your thing on load
    		}
    	}
    };
    
    
    Ext.getStore('datastore').load();
    Hope it helps you out. I have used the same store with no problems. I keep switching out different proxies on it too.

  5. #5
    Sencha User
    Join Date
    May 2014
    Location
    Mexico
    Posts
    2
    Vote Rating
    0
    WilliamPrater is on a distinguished road

      0  

    Default


    I have written approximately the same code but don't know Auto load is not working for me Any suggestion ?

Thread Participants: 2

Tags for this Thread