     filesEnumerated = 0
     
     onRecord = (res, record)=>
-      console.log "Found file: #{res.key}" if res?
+      #console.log "Found file: #{res.key}" if res?
       grid = "{#{record.gridN};#{record.gridM}}"
       if grid isnt lastGrid
         #loading next group

      rqStoreData.onerror = (e)=>
        console.log "Error storing data #{e.target.error}"
      rqStoreData.onsuccess = (e)=>
        console.log "Stored data OK, key is #{e.target.result}"
        #console.dir e.target
        key = e.target.result
        #console.log "Store catalog record"
        catalogRecord =
          gridN: (Math.random()*4)|0+4
          gridM: (Math.random()*4)|0+4
          name: "File #{i+1}"
          funcId: "B 3 S 2 3"
          funcType: "binary"
          base: 'e'
          offset: M.eye()
          field: key


    console.log "Loaddata"
    transaction = @db.transaction ["catalog"], "readonly"
    filesStore = transaction.objectStore "catalog"
    cursor = filesStore.index("catalogByGrid").openCursor()
    @loadFromCursor cursor, (rec)->true

  loadDataFor: (gridN, gridM, funcId) ->
    transaction = @db.transaction ["catalog"], "readonly"
    catalog = transaction.objectStore "catalog"
    catalogIndex = catalog.index "catalogByGrid"
    cursor = catalogIndex.openCursor()
    @loadFromCursor cursor, (rec)->
      (rec.gridN is gridN) and (rec.gridM is gridM) and ((funcId is null) or (rec.funcId is funcId))    
    
  loadDataFor1: (gridN, gridM, funcId) ->
    transaction = @db.transaction ["catalog"], "readonly"
    filesStore = transaction.objectStore "catalog"
    #create range
