   template = this
   data = @data
   domNode = getDomNode(this)
-  settings = data.settings
+  settings = getSettings()
   $table = $(@$('.reactive-table')).addClass('ui selectable table segment')
   $collectionTable = @$('.collection-table')
 

    group: tableId
    rowsPerPage: 10
    showFilter: true
  }, Setter.clone(data.settings))
  fields = settings.fields = settings.fields or []
  checkbox = settings.checkbox
  if checkbox

    throw new Error('No template provided')
  template.find '.collection-table'

getTemplate = (arg) ->
  if arg instanceof Blaze.TemplateInstance
    template = arg
  else
    element = $(arg)[0]
    if element
      return Blaze.getView(element).templateInstance()
  try
    Templates.getNamedInstance(templateName, template)
  catch err
    throw new Error('No element provided')

getSettings = (domNode) -> getTemplate(domNode).settings

