js code wrapped to allow multiple grids

if sort the items on another grid, only the last one created get refreshed