|
|||||||
![]() |
|
|
Thread Tools |
|
#1
|
|||
|
|||
|
hi
i am trying something like that: StoreZ= StoreX-StoreY i want to remove all the record from StoreX which is in StoreY and rest record i want to assign to StoreZ. Can anyone help me ![]() Thanks in advance Neeraj |
|
#2
|
|||
|
|||
|
Can we use the filter to solve this?
But how? |
|
#3
|
|||
|
|||
|
Sounds easier to implement server side with some kind of join?
If you can't do that post some code that you're working with. Your question is too vague to make suggestions on I think. You have records, remove them from one store and add them to another store. How you're going to implement that depends on your business logic, no?
__________________
MJ API Search || Ext 3: docs-demo-upgrade guide || User Extension Repository Frequently Asked Questions: FAQs Tutorial: Grid (php/mysql/json) , Application Design and Structure || Extensions: MetaGrid, MessageWindow |
|
#4
|
|||
|
|||
|
I am implementing the itemselector.
items:[{
xtype:"itemselector",
id: "itemSelectorID",
name:"itemSelector",
hiddenName:"itemSelector",
fieldLabel:"ItemSelector",
dataFields:["id", "display"],
mode:"local",
toStore: xStore,
fromStore: yStore,
msWidth:370,
msHeight:225,
valueField:"id",
displayField:"display",
toLegend:"Assigned",
fromLegend:"Available",
stripe:true
}]
var xStore = new Ext.data.Store({
reader : jsonReader,
autoLoad : true,
proxy : new Ext.data.HttpProxy({
url : 'loadXStore.action'
})
});
var yStore = new Ext.data.Store({
reader : jsonReader,
autoLoad : true,
proxy : new Ext.data.HttpProxy({
url : 'loadYStore.action'
})
});
Thanks for your reply mjlecomte ![]() |
|
#5
|
||||
|
||||
|
I don't really see how this is a problem? Loop through each record in X, compare it against each record in Y, fill a store with the difference.
|
|
#6
|
|||
|
|||
|
I am trying like this but it gives some error -B[A] has no properties
var xStore = new Ext.data.Store({
reader : jsonReader,
autoLoad : true,
proxy : new Ext.data.HttpProxy({
url : 'loadXStore.action'
})
});
var yStore = new Ext.data.Store({
reader : jsonReader,
autoLoad : true,
proxy : new Ext.data.HttpProxy({
url : 'loadYStore.action'
}),
listeners:{
load :{fn:function(thisStore,option){
for(var i=1;i<this.getTotalCount();i++){
xStore.remove(this.getAt(i));//ERROR-B[A] has no properties
}
}}
}
});
|
|
#7
|
|||
|
|||
|
are you use ext-all-debug.js so you can inspect errors easier?
did you inspect via firebug to see what xstore is inside that function? Looks like a scope problem to me. Also looks like you should make sure xstore is loaded before operating on it. var yStore = new Ext.data.Store({
reader : jsonReader,
autoLoad : true,
proxy : new Ext.data.HttpProxy({
url : 'loadYStore.action'
}),
listeners:{
load :{fn:function(thisStore,option){
console.log('inside load listener, xStore = ', xStore);//undefined?
for(var i=1;i<this.getTotalCount();i++){
xStore.remove(this.getAt(i));//ERROR-B[A] has no properties
}
}}
}
});
__________________
MJ API Search || Ext 3: docs-demo-upgrade guide || User Extension Repository Frequently Asked Questions: FAQs Tutorial: Grid (php/mysql/json) , Application Design and Structure || Extensions: MetaGrid, MessageWindow |
|
#8
|
|||
|
|||
|
I think it is trying to find the startIndex and endIndex but these store i am using in Multiselect box mean no startIndex and endIndex.
ext-all-debug.js .......
updateIndexes : function(startIndex, endIndex){
var ns = this.all.elements;
startIndex = startIndex || 0;
endIndex = endIndex || ((endIndex === 0) ? 0 : (ns.length - 1));
for(var i = startIndex; i <= endIndex; i++){
ns[i].viewIndex = i;//ERROR-ns[i] has no properties
}
},
.........
And what should be the alternative way to remove the record? |
![]() |
| Thread Tools | |
|
|