       messageProperty: 'message'
                    },
                    writer: {
                        type: 'json',
                        encode: true,
                        root: 'details'
                    },
                    fields: ['id','document', 'date'],
                },
            });`.

In both the cases i am calling the same action and getting the same JSON.
Can anyone help me out here that how can I declare another store object and get the value from the existing 'store' so that i should not have to load the same data for 2 times.
Regards : Dev

A:

You can make the first store have autoload set to false.  Then in the second store use the load event to inject the records into the first using that stores active proxy data:
var store2 = Ext.create('Ext.data.Store', {
    model: 'Writer.Document',
    autoLoad: true,
    proxy: {
        type: 'ajax',            
        url : 'findPatientRecordAction',
        reader: {
            type: 'json',
            successProperty: 'success',
            root: 'details',
            messageProperty: 'message'
        },
        writer: {
            type: 'json',
            encode: true,
            root: 'details'
        },
        fields: ['id','document', 'date'],
    },
    listeners: {
        load: function(store, records, successful, eOpts){
            if(successful)
            {
                store1.loadData(store.proxy.reader.rawData.data);
            }
        }
    }
});



Q:

Replace function not replacing

I followed some documentation to use the JavaScript replace function and it's not changing anything. No errors are thrown. Any idea what I'm doing wrong? The variable is retrieved from XML - maybe it needs to be cast as a string or something?
for (var i = 0, iln = projects.length; i < iln; i++){
    var thumb = projects[i].get('thumb');
    thumb.replace("200.jpg", "640.jpg");
    console.log(thumb) //200.jpg not replaced
}

The full thumb value should look like this:
http://b.vimeocdn.com/ts/160/895/160895498_200.jpg