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.
Unfortunately, activation email could not send to your email. Please try again.

Cancel on beforeActive

Thread ID:

Created:

Updated:

Platform:

Replies:

118083 Jan 30,2015 04:11 AM Feb 3,2015 10:34 PM JavaScript 3
loading
Tags: ejTab
Stefano Enrico
Asked On January 30, 2015 04:11 AM

Hi,

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.

tab

<script type="text/javascript">
 
    $(document).ready(function () {
 
        $("#tab").ejTab({
            width: "300px",
            beforeActive: function (args) {
                if (args.activeIndex == 1) args.cancel = true;
            }
        });
 
    });
 
</script>
<div id="tab">
    <ul>
        <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>
    </ul>
    <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>
    <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>
    <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.
    </div>
</div>

Thanks

Stefano


Attachment: TabChange_8433e6db.zip

Sasikala Nagarajan [Syncfusion]
Replied On February 2, 2015 08:00 AM

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.

https://www.syncfusion.com/account/login?ReturnUrl=/support/directtrac/incidents

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

[_Script]

<script>

    var tabObj;

    $(document).ready(function () {

        $("#tab").ejTab({

            width: "300px",

            beforeActive: onBeforeActive,

        });

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

    });

    function onBeforeActive(e) {

        if (e.activeIndex == 1) {

            e.cancel = true;

            tabObj.showItem(e.prevActiveIndex);

        }

    }

 </script>

Regards,

Sasikala Nagarajan



Stefano Enrico
Replied On February 2, 2015 09:57 AM

Hi Sasikala Nagarajan,

thanks for the work around solution.

Stefano

Sasikala Nagarajan [Syncfusion]
Replied On February 3, 2015 10:34 PM

Hi Stefano,
Thanks for the update

Please let us know if you have further queries,

Regards,

Sasikala Nagarajan



CONFIRMATION

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.

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.

;