This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

Page ID on change page event
#1
Hello,

We are trying to add a button that takes the user to previous page.

The link option to 'previous plan' doesn't work like we want..

We are trying with JS but we don't know how to save the ID plan on change plan event.

Is this posible?

Thanks!
Reply
#2
New firmware has showplan event which can be used to get new plan id when it changes.
Use this custom JS, it attaches to all elements with back class and replaces click handler with "back" action.
Code:
$(function() {
  var curr_id = currentPlanId, prev_id;

  $('body').on('showplan', function(event, new_id) {
    prev_id = curr_id;
    curr_id = new_id;
  });
  
  $('.back').off('vclick').on('vclick', function() {
    showPlan(prev_id);
  });
});
Reply
#3
(13.07.2020, 08:14)admin Wrote: New firmware has showplan event which can be used to get new plan id when it changes.
Use this custom JS, it attaches to all elements with back class and replaces click handler with "back" action.
Code:
$(function() {
  var curr_id = currentPlanId, prev_id;

  $('body').on('showplan', function(event, new_id) {
    prev_id = curr_id;
    curr_id = new_id;
  });
 
  $('.back').off('vclick').on('vclick', function() {
    showPlan(prev_id);
  });
});

Working perfect!

Thanks.
Reply


Forum Jump: