1
votes

I'm using onsen-ui splitView.
Can I do callback after mainpage changed?

This is my code:

<ons-list-item 
    modifier="chevron"
    ng-click="ons.splitView.toggle(); ons.splitView.setMainPage('report.html');"
    class="label-sm font-sm"
    onclick="report()">
    <i class="fa fa-bar-chart fa-lg" style="color: #666"></i>
    &nbsp; Report
</ons-list-item>
1

1 Answers

1
votes

Yes, there's a presplit and a postsplit event. There are also precollapse and postcollapse events. You can use them to attach callbacks.

ons.splitView.on('postsplit', function(e) {
  console.log(e);
});

The event object has the following properties:

e.splitView // Splitview object
e.width // Window width
e.orientation // "landscape" or "portrait"

Hope this helps! :)