3

i want to display the ion-refresher programmatically. e.g on the first page load i load the data and want to show the ion-refresher. i've not found any build in function only _beginRefresh. this function will fire the refresher, however it will not set the style attribute TOP on the refresher element. therefore it is hidden behind the NAV.

currently i've created a dirty workaround.

let scrollcontent = document.getElementsByClassName('ion-page')[0].getElementsByTagName('ion-content')[0].getElementsByClassName('scroll-content')[0]
let rect = scrollcontent.getBoundingClientRect()
document.getElementById('refresher').style.top = rect.top.toString() + 'px'
this.myRefresher._beginRefresh()

i'm wondering if there is a better aproach. thanks

David
  • 7,387
  • 3
  • 22
  • 39
markus
  • 475
  • 10
  • 27

1 Answers1

0

ok i've found a better approach...

@ViewChild(Content) ContentDashboard: Content;
this.RefresherDashboard._top = this.ContentDashboard.contentTop.toString() + 'px'
this.RefresherDashboard._beginRefresh()
markus
  • 475
  • 10
  • 27