     
     adapter = plugin.adapter
     
-    table = data.flexiTable
+    table = plugin.flexiTable
     table.find("tr:not(.fr-header)").remove()
     
     for item in adapter.paginatedData()

  plugin.destroy = ->
    $el.data 'flexirails', null
    $el.find(".fr-table").remove()

  # set up a datasource for flexirails
  plugin.initializeAdapter = (ds) ->

    data = $el.data 'flexirails'
  
    $el.append data.createFlexiTable data
    plugin.flexiTable = $el.find '.fr-table'
  
  # append flexirails navigation elements 
  createNavigation = ->
    data = $el.data 'flexirails'
  
    $el.append data.createFlexiNavigation plugin.adapter
    $(data.createFlexiNavigation plugin.adapter).insertBefore plugin.flexiTable
    plugin.flexiNavigation = $el.find '.fr-navigation'
    
    bindNavigation()
  
  # bind events to navigational elements
  bindNavigation = ->
