     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 (el) ->
-    row = []
-    for field in fields
-      val = el[field] ? `undefined`
-      row.push value: val
-    row
+  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

    result.header =
      columns: labels

  opts =
    sort: @_sort
    fields: @_fields

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

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

Template.ReactiveTable.rendered = ->
  console.log "table rendered"
