   setRowOverdraw: (@rowOverdraw) -> @requestUpdate(true)
 
   getFirstVisibleRow: ->
-    row = Math.floor(@scrollView.scrollTop() / @getRowHeight())
+    row = Math.floor(@body.scrollTop() / @getRowHeight())
 
   getLastVisibleRow: ->
-    scrollViewHeight = @scrollView.height()
+    scrollViewHeight = @body.height()
 
-    row = Math.floor((@scrollView.scrollTop() + scrollViewHeight) / @getRowHeight())
+    row = Math.floor((@body.scrollTop() + scrollViewHeight) / @getRowHeight())
 
   #     ######   #######  ##       ##     ## ##     ## ##    ##  ######
   #    ##    ## ##     ## ##       ##     ## ###   ### ###   ## ##    ##

  @content: ->
    @div class: 'table-edit', =>
      @table outlet: 'tableHeaderView', class: 'table-edit-header'
      @div outlet: 'scrollView', class: 'scroll-view', =>

  initialize: (@table) ->
    @subscriptions = new CompositeDisposable
    @scroll = 0

    props = {@table, parentView: this}
    @component = React.renderComponent(TableComponent(props), @scrollView[0])

    @subscriptions.add @table.onDidChangeRows @requestUpdate
    @subscriptions.add @table.onDidAddColumn @onColumnAdded
    @subscriptions.add @table.onDidRemoveColumn @onColumnRemoved

    @subscriptions.add @asDisposable @scrollView.on 'scroll', @requestUpdate

    @subscribeToColumn(column) for column in @table.getColumns()



  scrollTop: (scroll) ->
    if scroll?
      @body.scrollTop(scroll)
      @requestUpdate()

    @body.scrollTop()

  requestUpdate: (forceUpdate=false) =>
    @hasChanged = forceUpdate
