 Template.ReactiveTable.helpers
   data: ->
     @_table = new ReactiveTable @options
-    @_table.getData()
+    log = @_table.getData()
+    console.log log
+    log
 
 Template.ReactiveTable.rendered = ->
   console.log "table rendered"

    result.header =
      columns: labels

  opts =
    sort: @_sort
    fields: @_fields

  query = {}
  if @_query instanceof Array
    query["$or"] = @_query

    maxPages = totalPages - pageBase
    if maxPages > opt_maxPages
      maxPages = opt_maxPages
    {
      page: idx+1+pageBase
      active: idx+1+pageBase is data.page
    } for idx in [0..maxPages-1]
  )(@_options.maxPages)

  data.rows = found.map (row, index) ->
    {
      rowIndex: index + 1    # startIndex + rowIndex <= endIndex
      values: (row[field] ? `undefined` for field in fields)
    }

  if data.rows.length > 0 or showBodyIfNoData
    result.data = data
