multi grid and events


In my page, i use two grids. When a event is sent on a grid, i don’t know in which grid i am. When i’m in a function attached on custom sorting i don’t know which grid is sorting. I can’t imagine, i must write a function for each grid.


Inside event handler, “this” always points to the grid object, for which event was called

// this == mygrid

But it’s not true in a function of custom sorting. How can i know in which grid i’m in this case?


There is no way to detect such info in case of custom sorting.
If you really need it , then

var currentGrid=null;
var setGrid = function(){ currentGrid = this; return true; }

now, inside custom sorting method you will be able to access currentGrid variable.