Nov 03, 2011, 7:10 AM
[CLOSED] Store: Is it possible to QueryBy a store with another store?
Hi,
I have 2 stores, LEFT (source) and RIGHT (shopping cart).
What I want to do is when the item exist in the RIGHT store, it will hide the LEFT by setting "HideLeftRow" as true.
(virtually moving an item from LEFT to RIGHT). Below is the code I am using now and it is working fine.
But my LEFT store can go up to 1000 items, and if the RIGHT store contains about 200 items, and when this happens, it is very slow.
I am wondering if its possible to use QueryBy with another store, and if it is possible, will this improve the performance?
Something like this? << not working, just thinking out loud >>
Or is there any other way that might help this function run faster?
Thanks, J
I have 2 stores, LEFT (source) and RIGHT (shopping cart).
What I want to do is when the item exist in the RIGHT store, it will hide the LEFT by setting "HideLeftRow" as true.
(virtually moving an item from LEFT to RIGHT). Below is the code I am using now and it is working fine.
But my LEFT store can go up to 1000 items, and if the RIGHT store contains about 200 items, and when this happens, it is very slow.
gridRight.store.each(function(record, index) {
var index = gridLeft.store.findExact('LeftID',record.get('RightID'));
if(index >= 0){
var recordLeft = gridLeft.store.getAt(index);
recordLeft.set('HideLeftRow', true);
}
});
I am wondering if its possible to use QueryBy with another store, and if it is possible, will this improve the performance?
Something like this? << not working, just thinking out loud >>
gridLeft.store.queryBy(function(records){
records (in gridRight);
}
Or is there any other way that might help this function run faster?
Thanks, J
Last edited by Daniil; Nov 03, 2011 at 9:40 AM.
Reason: [CLOSED]