vaduros
19 May 2007, 8:16 AM
I'm working on an application where I've added an event listener to the row selection model of a grid
var rsm = new Ext.grid.RowSelectionModel({singleSelect:true});
rsm.addListener('rowselect',
function (grid, rowIndex, e) {
ra = nstore.getAt(rowIndex);
fnum = ra.get(cm.getDataIndex(0));
mwert = ra.get(cm.getDataIndex(3));
showDetails(fnum,mwert);
});
When this grid, the 'parent' grid is loaded or the ds of the grid is modified, this event is trigger and loads another grid, the 'child' grid, via the showDetails function. showDetails just renders the 'child' grid and loads its own ds the the first time it is invoked or just loads its ds on subsequent calls.
What I can see using firebug is that the load method of the 'child' grid fires several POST requests to the ds script (dfget.php) until the 'parent' grid is finally rendered. It seems as if the data source script is blocked from sending data until the rendering of the 'parent' grid has finished (both grids use the same ds script with different parameters). That doesn't make sense to me. We DO deal with asynchronous requests here, don't we? And when I look into the server log, I can see that in fact only ONE POST request has happened (or maybe finished), even when firebug reports several tries.
I've attached a screenshot from firebug. At the point in time where the arrows point to, the ds script has finished sending the JSON data for the 'parent' grid, but the ds of the 'child' grid is still trying to get JSON data from the ds script.
Anybody with an explanation for this behavior?
var rsm = new Ext.grid.RowSelectionModel({singleSelect:true});
rsm.addListener('rowselect',
function (grid, rowIndex, e) {
ra = nstore.getAt(rowIndex);
fnum = ra.get(cm.getDataIndex(0));
mwert = ra.get(cm.getDataIndex(3));
showDetails(fnum,mwert);
});
When this grid, the 'parent' grid is loaded or the ds of the grid is modified, this event is trigger and loads another grid, the 'child' grid, via the showDetails function. showDetails just renders the 'child' grid and loads its own ds the the first time it is invoked or just loads its ds on subsequent calls.
What I can see using firebug is that the load method of the 'child' grid fires several POST requests to the ds script (dfget.php) until the 'parent' grid is finally rendered. It seems as if the data source script is blocked from sending data until the rendering of the 'parent' grid has finished (both grids use the same ds script with different parameters). That doesn't make sense to me. We DO deal with asynchronous requests here, don't we? And when I look into the server log, I can see that in fact only ONE POST request has happened (or maybe finished), even when firebug reports several tries.
I've attached a screenshot from firebug. At the point in time where the arrows point to, the ds script has finished sending the JSON data for the 'parent' grid, but the ds of the 'child' grid is still trying to get JSON data from the ds script.
Anybody with an explanation for this behavior?