PDA

View Full Version : Two stores entity name error



gustavoliveira
9 Oct 2014, 1:28 PM
Hello,

I have two models (Model1, Model2) and two stores (Store1, Store2).
I am trying to create a page with two grids, each grid with one different store. Each grid have a action with this code:



//grid1
var removeActionGrid1 = Ext.create('Ext.Action', {
text: 'Remove',
handler: function (widget, event) {
var rec = grid1.getSelectionModel().getSelection()[0];
if (rec) {
console.log(rec);
}
}
});

//grid2
var removeActionGrid2 = Ext.create('Ext.Action', {
text: 'Remove',
handler: function (widget, event) {
var rec = grid2.getSelectionModel().getSelection()[0];
if (rec) {
console.log(rec);
}
}
});



Each grid load the correct data, but when I click in the action on Grid1 or Grid2, in the browser console logs the correct object but the entity name always is Model2, only when I remove the Store2 the console logs entity name as Model1.

Sorry for my english, I dont know if its clear. Someone knows whats happen?

glopes
10 Oct 2014, 10:26 AM
Can you provide a fiddle with your code?

gustavoliveira
10 Oct 2014, 12:21 PM
Actually, I discovered the problem: I used the same reader for the two proxies. Its necessary create different readers. Thanks.