SHARE
TWEET
loading issue
a guest
Oct 4th, 2016
15
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
- scope.downloadReport = ->
- scope.reportLoading = true
- scope.oldPerPage = angular.copy(scope.perPage)
- scope.perPage = null
- scope.unbindWatcher = scope.$watch (-> $('.overflow-scroller table tbody tr').length), (newValue, oldValue) ->
- if newValue is scope.rowCount
- table = angular.copy($('.overflow-scroller table'))
- table.find('a').contents().unwrap()
- blob = new Blob [table.prop('outerHTML')], ->
- type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8"
- saveAs(blob, scope.reportName + '.xls')
- scope.perPage = scope.oldPerPage
- scope.unbindWatcher()
- 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.
