   configureSettings(@)
 
 TemplateClass.rendered = ->
-  template = this
+  @tableInterval = setInterval =>
+    if @$('.reactive-table').length > 0
+      clearInterval(@tableInterval)
+      onTableRender.call(@)
+  , 100
+  
+onTableRender = ->
+  template = @
   data = @data
-  domNode = getDomNode(this)
-  settings = getSettings()
-  $table = $(@$('.reactive-table')).addClass('ui selectable table segment ' + (settings.cls ? ''))
+  domNode = getDomNode(@)
+  settings = getSettings(@)
+
+  $table = @$('.reactive-table').addClass('ui selectable table segment ' + (settings.cls ? ''))
   $collectionTable = @$('.collection-table')
 
   createHandlerContext = (extraArgs) ->


configureSettings = (template) ->
  data = template.data
  items = data.items
  collection = data.collection
  if !collection
    if items
      collection = Collections.get(items)
    else
      throw new Error('Either or both of "items" and "collection" attributes must be provided.')
  else
    collection = Collections.get(collection)
  if !items
    items = collection
  # Store them for use in helpers.
  template.items = items
  template.collection = collection
  if !collection
    console.warn 'No collection provided.', data
  else
    collectionName = data.collectionName or Collections.getName(collection)
    if collectionName
      collectionId = Strings.firstToLowerCase(Strings.singular(collectionName))
      template.createRoute = data.createRoute or collectionId + 'Create'
      template.editRoute = data.editRoute or collectionId + 'Edit'
    else
      console.warn 'No collection name provided', data

  tableId = template.tableId
  # Clone settings to ensure the original isn't modified in case it's used across different table


TemplateClass.destroyed = ->
  _.each @collectionHookHandles, (handle) -> handle.remove()
  clearInterval(@tableInterval)

TemplateClass.events
  'click table.selectable tbody tr': (e, template) ->
