PDA

View Full Version : store, on reload bug



Guido
9 Aug 2007, 3:18 AM
Hi,

well I'm new to Ext-js as well.

I've got the following problem:

I have two grids, wich I connected to each other.
When changing selection on grid1 the store of grid2 is being updated.

All works fine as long as the store2 for grid2 gets records.
If the return array (to store2) doesn't contain records, it simply keeps the last set.

Any idea?

here are some code parts:


var Grid1Ds = new Ext.data.Store
(
{
proxy: new Ext.data.HttpProxy({url: 'data.php'}),
reader: new Ext.data.JsonReader
(
{
root: 'targets',
totalProperty: 'totalCount',
id: 'id'
},
[
{name: "id", mapping: 'id', type: 'int'},
{name: "targetType", mapping: 'targetType', type: 'string'},
{name: "targetTypeInstanceId", mapping: 'targetTypeInstanceId', type: 'int'},
{name: "targetInstanceName", mapping: 'targetInstanceName', type: 'string'}
]
),
baseParams:
{
method: "GET",
node: "target_product"
},
remoteSort: false
}
);



grid1.addListener
(
'click',
function(e)
{
Grid2.getDataSource().baseParams['node'] = 'selection_'+grid1.getSelectionModel().getSelected().id;
Grid2.getDataSource().reload();
}
);

mystix
9 Aug 2007, 7:54 AM
[ moved from Bugs to Help]

please read 8887 before posting in bugs.