<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> |
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
Hi Stefano,
Thanks for the update
Please let us know if you have further queries,
Regards,
Sasikala Nagarajan