Making the EJ2 TabPlugin have memory of the current Tab

I have Page #1, and Page#2, Page#1 has a tab plugin with 4 tabs, and from the third tab I could click a button and get to the Page #2, my business user is asking for that when they click a cancel button on the Page #2, their should come back to Page #1, and land with the third Tab being the current Tab.

What would be the best method to do this with least additional code???

 


1 Reply

SK Satheesh Kumar Balasubramanian Syncfusion Team February 9, 2022 03:05 PM UTC

Hi Wei,
We suggest you to use the Tab select public method to achieve your requirement.
Page2.vue:     
<template>
  <button id="goToNavigate" class='e-btn' v-on:click='btnClicked'>Cancel</button>
</template>
<script>
export default {
    name: "twitterTemplateVue",
      components: {
        },
    data() {
          return {
              data: {}
          };
      },
      methods: {
        btnClicked: function(){
          var tabObj = document.getElementById('tab_default').ej2_instances[0];
          tabObj.select(1); // You can pass the current tab index
        }
      }
};
</script>
Kindly try the above sample and let us know if this meets your requirement. If it still does not meet your requirement, please share the Page #1 and Page #2 related code snippets.
Regards,
Satheesh Kumar B



Loader.
Up arrow icon