Back event not work in V2

I want to use back event on V2 like V1


$$(document).on('page:back', function (e) {

There is no such event in v2, you can probably use “page:beforeout” and check the direction (from/to properties) in event.detail

It work, thank you sir.

Are you have know other events about page switch in V2? Share me please.

Hi, I have a view with several fields I want to update my database once I leave the page.
I’m using page:beforeout on this view to update my database.
The problem is that the fields are null.


any ideas?

Whats type it’t element ('#travel_detail_name_day') ?

Please, send you html file.

<input type="text" placeholder="Título" id="travel_detail_name_day" class="">

this my html element

Try it add it in your router.js

pageAfterOut: function () {
           var valor = $$("#travel_detail_name_day").val();

Sorry for my enligsh horrible. rsrs

More infos:

Hi, thanks for the response. I will try it.

1 Like

Ok, I right… look ‘tis:

pageAfterOut: function (e,page) {
1 Like

It worked with event call inside the router file

1 Like

Poste example. Very Good! Nice job.