     sTitle: "id"
     mData: "_id"
     bVisible: false
+    bSearchable: false
   # a function to add a default mRender function if one is not defined
   # iterate over the columns array and add mRender to the columns that need it
   @setDefaultCellValue column for column in columns

Template.dataTable.getTableState = ->
  return @getData().tableState or false


Template.dataTable.fnServerData = ( sSource, aoData, fnCallback, oSettings ) ->
  @setTableState aoData
  @setSubscriptionOptions
    skip: @getTableState().iDisplayStart
    limit: @getTableState().iDisplayLength
    sort: @getTableState().sort
  @setSubscriptionHandle Meteor.subscribe( @getSubscription(), @getTableState().query, @getSubscriptionOptions() )
  @setSubscriptionAutorun Deps.autorun =>
    if @getSubscriptionHandle() and @getSubscriptionHandle().ready()
      @log 'fnServerdData:handle:ready', @getSubscriptionHandle().ready()
      cursorOptions =
        skip: 0
        limit: @getTableState().iDisplayLength
        sort: @getTableState().sort
      @setCursor @getCollection().find @getTableState().query, cursorOptions
      aaData = @getCursor().fetch()
      @log 'fnServerData:aaData', aaData
      fnCallback
        # An unaltered copy of sEcho sent from the client side.
        # This parameter will change with each draw (it is basically a draw count)

#====== /Pagination ======#

#====== Utility ======#
Template.dataTable.getTemplateInstance = ->
  return @templateInstance or false

Template.dataTable.getGuid = ->
  return @guid or false

Template.dataTable.getData = ->
  return @getTemplateInstance().data or false

Template.dataTable.setData = ( key, data ) ->
  @templateInstance.data[ key ] = data

Template.dataTable.setDefaultCellValue = ( column ) ->
  Match.test column.mData, String
  Match.test column.sTitle, String
