View Full Version : copy store / execute same load

4 May 2012, 11:47 AM
is there a way to get a store copy with all the params that was used to load the original store ?

This is an example for what im trying to accomplish

store1.loadPage(3); // Loads the page 3
store1.load(); // Loads the page 3 because keeps the config
// for page, limit, start, sortes, filters, etc as configs

// This is what im trying to do
store2 = store1.getCopy() // getCopy doesnt exists
//just an example to copy all store1 config,
// like the current page number, the current
//sorters, filters, proxy extra params, etc.
//doesnt matter if copies the records too.

store2.load(); // Should trigger the same http request as doing store1.load();

im not trying to copy records from store1 to store2, im trying to copy the config so their load will send the same http request.

the reason is that when doing store2.load() ill add another special config that will execute exactly the same query but with a lil change and i dont want to interfere in store1 current records and whats user is seeying in the web site.

5 May 2012, 1:38 AM
why you just not create a new store !!?.

5 May 2012, 10:28 AM
creating a new store wont have the same page, limit, sorters, filters etc from the store1
creating a new instance != copying an instance :d

6 May 2012, 12:06 AM
I meant to define your store with the required configs(page, limit...etc) then create a instance of it.