SHARE
TWEET

loading issue

a guest Oct 4th, 2016 15 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.     scope.downloadReport = ->
  2.       scope.reportLoading = true
  3.       scope.oldPerPage = angular.copy(scope.perPage)
  4.       scope.perPage = null
  5.  
  6.       scope.unbindWatcher = scope.$watch (-> $('.overflow-scroller table tbody tr').length), (newValue, oldValue) ->
  7.         if newValue is scope.rowCount
  8.           table = angular.copy($('.overflow-scroller table'))
  9.           table.find('a').contents().unwrap()
  10.           blob = new Blob [table.prop('outerHTML')], ->
  11.             type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8"
  12.           saveAs(blob, scope.reportName + '.xls')
  13.  
  14.           scope.perPage = scope.oldPerPage
  15.           scope.unbindWatcher()
  16.           scope.reportLoading = false
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top