 
   scrollTop: (scroll) ->
     if scroll?
-      @scrollView.scrollTop(scroll)
+      @body.scrollTop(scroll)
       @requestUpdate()
 
-    @scrollView.scrollTop()
+    @body.scrollTop()
 
   requestUpdate: (forceUpdate=false) =>
     @hasChanged = forceUpdate

  @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()


  setRowOverdraw: (@rowOverdraw) -> @requestUpdate(true)

  getFirstVisibleRow: ->
    row = Math.floor(@body.scrollTop() / @getRowHeight())

  getLastVisibleRow: ->
    scrollViewHeight = @body.height()

    row = Math.floor((@body.scrollTop() + scrollViewHeight) / @getRowHeight())

  #     ######   #######  ##       ##     ## ##     ## ##    ##  ######
  #    ##    ## ##     ## ##       ##     ## ###   ### ###   ## ##    ##
