       callback e.statuses
     else
       alert "開栓情報が取得できませんでした"
+
+beginUpdate = () ->
+  updating = true
+  $.activityIndicator.show()
+  setTimeout(endUpdate,2000)
+
   
+endUpdate = () ->
+  updating = false
+  $.tableview.deleteRow(showRows,{})
+  statusesQuery(pageNumber,(statuses) ->
+    newSection = createOnTapInfo(statuses)
+    $.tableview.insertSectionAfter(pageSection,newSection)
+    pageNumber++
+    pageSection++
+
+  )   
+  
+
+$.tableview.addEventListener 'scroll', (e) ->
+  if Ti.Platform.osname is "iphone"
+    offset = e.contentOffset.y
+    height = e.size.height
+    total = offset + height
+    theEnd = e.contentSize.height
+    distance = theEnd - total
+    Ti.API.info "#{distance} #{lastDistance}"
+    if distance < lastDistance
+      nearEnd = theEnd * .75
+      Ti.API.info "nearEnd is #{nearEnd}"
+      if not updating and (total >= nearEnd)
+        beginUpdate()
+        
+    lastDistance = distance
+
+      
+
 exports.move = (_tab) ->
   _tab.open $.onTapWindow
   statusesQuery pageNumber,(statuses) ->

Cloud = require("ti.cloud")
pageNumber  = 1
pageSection = 0
if Ti.Platform.name is 'iPhone OS'
  style = Ti.UI.iPhone.ActivityIndicatorStyle.DARK
else

    $.tableview.setData [section]

  
$.tableview.addEventListener 'click', (e) ->
  shopData = e.row.shopData
  shopDataDetailController = Alloy.createController('shopDataDetail')
