We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Cancel on beforeActive

Thread ID:





118083 Jan 30,2015 09:11 AM UTC Feb 4,2015 03:34 AM UTC JavaScript 3
Tags: ejTab
Stefano Enrico
Asked On January 30, 2015 09:11 AM UTC


i  have a multitab with three tabs. When i click on second tab i would to remain on previous tab. 
If i set true or "cancel" param, the multitab does not show nothing.
It's the right method? My need is to block the user on the active tab programmatically.


<script type="text/javascript">
    $(document).ready(function () {
            width: "300px",
            beforeActive: function (args) {
                if (args.activeIndex == 1) args.cancel = true;
<div id="tab">
        <li><a rel='nofollow' href="#javaScript">JavaScript</a></li>
        <li><a rel='nofollow' href="#cSharp">C Sharp (C#)</a></li>
        <li><a rel='nofollow' href="#vb">VB.Net</a></li>
    <div id="javaScript">
        JavaScript (JS) is an interpreted computer programming language.
        It was originally implemented as part of web browsers so that client-side scripts could interact with the user, control the browser, communicate asynchronously, and alter the document content that was displayed. More recently, however, it has become common in both game development and the creation of desktop applications.
    <div id="cSharp">
        C# is intended to be a simple, modern, general-purpose, object-oriented programming language. Its development team is led by Anders Hejlsberg. The most recent version is C# 5.0, which was released on August 15, 2012.
    <div id="vb">
        The command-line compiler, VBC.EXE, is installed as part of the freeware .NET Framework SDK. Mono also includes a command-line VB.NET compiler. The most recent version is VB 2012, which was released on August 15, 2012.



Attachment: TabChange_8433e6db.zip

Sasikala Nagarajan [Syncfusion]
Replied On February 2, 2015 01:00 PM UTC

Hi Stefano,

We considered this requirement “args.cancel==true should block the opening the new tab and also it’s should be remains in previous tab” as bug and a support incident has been created under your account to track the status of this requirement. Please log on to our support website to check for further updates.


For your convenience we have prepared the work around solution to achieve your requirement. Please use below code snippet to achieve your reported requirement



    var tabObj;

    $(document).ready(function () {


            width: "300px",

            beforeActive: onBeforeActive,


        tabObj = $("#tab").data("ejTab");


    function onBeforeActive(e) {

        if (e.activeIndex == 1) {

            e.cancel = true;






Sasikala Nagarajan

Stefano Enrico
Replied On February 2, 2015 02:57 PM UTC

Hi Sasikala Nagarajan,

thanks for the work around solution.


Sasikala Nagarajan [Syncfusion]
Replied On February 4, 2015 03:34 AM UTC

Hi Stefano,
Thanks for the update

Please let us know if you have further queries,


Sasikala Nagarajan


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon