1. #1
    Sencha User chrizmaster's Avatar
    Join Date
    Feb 2009
    Location
    Australia
    Posts
    441
    Vote Rating
    1
    chrizmaster is on a distinguished road

      0  

    Default copy data from one store to another

    copy data from one store to another


    Hi,

    I have a localstorage which holds data as a cache. Everytime I start my webapp, i ask the server if new data is available. if so, I set up a store with jsonProxy, collect the data and copy it from this store to the localstorage.

    Is there any better method then iterating over the jsonstore data and copy it record by record into the localstorage? This is not the fastest operation on the iphone and I currently try to find a way which performs faster than this..

    Chriz

  2. #2
    Sencha User
    Join Date
    Feb 2011
    Posts
    8
    Vote Rating
    1
    mikeycgto is on a distinguished road

      1  

    Default


    Was wondering myself, doesnt seem to be anything built-in really for this. I have something like the following:

    Code:
    store2 = new Ext.data.Store();
    store1.each(function(record){
      store2.add(record.copy());
    });

  3. #3
    Sencha User
    Join Date
    Sep 2011
    Location
    Chennai, Tamil Nadu
    Posts
    24
    Vote Rating
    0
    Jay Tanwar is on a distinguished road

      0  

    Thumbs up Thnx..

    Thnx..


    Dude mikeycgto,
    you saved my day..

  4. #4
    Sencha User
    Join Date
    Oct 2012
    Posts
    25
    Vote Rating
    0
    deepakpoda2000 is on a distinguished road

      0  

    Default doubt

    doubt


    am not even able to iterate through the store

    gives the below error
    Uncaught TypeError: Cannot call method 'indexOf' of undefined



    am using something like this
    foodAllergiesGridStore.each(function(record){
    //begg.add(record.copy());
    console.log('asdf');
    });

  5. #5
    Sencha Premium Member
    Join Date
    Mar 2012
    Location
    germany
    Posts
    14
    Vote Rating
    -1
    Yacine BRITAH is an unknown quantity at this point

      0  

    Default


    Dońt use record.copy, just add the parameter in each loop

Similar Threads

  1. Store copy
    By anishanc in forum Ext 2.x: Help & Discussion
    Replies: 3
    Last Post: 29 Jun 2009, 7:44 PM
  2. Copy data in Grid.
    By sugen in forum Ext 2.x: Help & Discussion
    Replies: 5
    Last Post: 30 Nov 2008, 11:30 PM
  3. take copy from store
    By mnask in forum Ext 2.x: Help & Discussion
    Replies: 1
    Last Post: 23 Mar 2008, 4:05 AM
  4. copy data store instead of reference (resolved)
    By para in forum Ext 1.x: Help & Discussion
    Replies: 3
    Last Post: 22 May 2007, 11:31 AM
  5. How to copy data in the clipboard using JavaScript?
    By liotrox in forum Ext 1.x: Help & Discussion
    Replies: 1
    Last Post: 22 Mar 2007, 7:00 AM

Thread Participants: 4

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