           templates   : filterDeclaration.declaration.templates
           ids         : filterDeclaration.declaration.ids
 
-    window[gridName] = gridProcessor
+    unless window[globalVarForAllGrids]
+      window[globalVarForAllGrids] = {}
+
+    window[globalVarForAllGrids][gridName] = gridProcessor
 
     setupDatepicker()
     setupSubmitReset wiceGridContainer, gridProcessor

$(document).on 'page:load ready', -> initWiceGrid()

initWiceGrid = ->



getGridProcessorForElement = (element) ->
  gridName = $(element).data('grid-name')
  if gridName && window[globalVarForAllGrids]
    window[globalVarForAllGrids][gridName]
  else
    null

