Results 1 to 5 of 5

Thread: How to clone a store

  1. #1
    Sencha User tdikarim's Avatar
    Join Date
    Jun 2007
    Location
    Belgium - Brussel
    Posts
    142

    Default How to clone a store

    Hi,

    I have a store that is configured by metadata.

    I want to move in another store all the row that the user have deleted.
    The goal is to have an "undo delete" and display all the deleted row in another grid

    Thanks for your help
    Tamditi Karim

  2. #2
    Sencha User
    Join Date
    Jun 2011
    Location
    Chennai, India
    Posts
    17

    Default Store to store copy

    See whether this solves part of your problem
    Code:
      	 // copying 'store1' data to 'store2'  	    var records = []; 	    store.each(function(r){ 		            records.push(r.copy()); 	    }); 	    var store2 = new Ext.data.Store({ 					                           recordType: store1.recordType 				                       }); 	     store2.add(records);
    Last edited by Madhu11; 29 Sep 2011 at 8:50 AM. Reason: formatting
    When student is ready, teacher appears

  3. #3
    Sencha User
    Join Date
    Jun 2011
    Location
    Chennai, India
    Posts
    17

    Default

    despite my best effort I could not format it
    When student is ready, teacher appears

  4. #4
    Sencha User tdikarim's Avatar
    Join Date
    Jun 2007
    Location
    Belgium - Brussel
    Posts
    142

    Default

    Quote Originally Posted by Madhu11 View Post
    See whether this solves part of your problem
    Code:
      	 
    // copying 'store1' data to 'store2'  	    
    var records = []; 	    
    store.each(function(r){
    	records.push(r.copy()); 	    
    }); 	    
    var store2 = new Ext.data.Store({ 			
    	recordType: store1.recordType
    }); 	     
    store2.add(records);
    Thanks
    I wil try that ...
    Tamditi Karim

  5. #5
    Sencha User
    Join Date
    Jun 2011
    Location
    Chennai, India
    Posts
    17

    Default Did it help?

    Did it help?
    When student is ready, teacher appears

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •