Am I on a tab? Is that tab active?

3 posts, 0 answers
  1. Karl
    Karl avatar
    3 posts
    Member since:
    Mar 2015

    Posted 09 Sep 2015 Link to this post


    OK, not really used Rad controls before but I have to fix a bug in some code that contains a RadTab.

    I have a javascript function, which is called onblur for a control.

    Now this control may or may not be on a RadTab, so it won't know the id of the the RadTab control.  How in my javascript function can I check that the control is on a RadTab and if that tab is active?

    I am assuming I can check the parent oject type?  but what am I looking for?  Any help greatly appreciated.

  2. Karl
    Karl avatar
    3 posts
    Member since:
    Mar 2015

    Posted 09 Sep 2015 in reply to Karl Link to this post

    I have noticed that the container div has a control attribute control="[object Object]", can I check the object type?  of the value of  control and if so, what object type am I looking for? 
  3. DevCraft R3 2016 release webinar banner
  4. Nencho
    Nencho avatar
    1446 posts

    Posted 12 Sep 2015 Link to this post

    Hello Karl,

    The desired functionality could be implemented using jQuery. You can subscribe for the blur event of the control and get all its parents. Thus, you can check for each one of them, if their ID contains "PageView". f course, for that purpose you need to set similar IDs for the PageViews, associated with the RadTabs (e.g. "RadPageView_Home").

    In addition, in order to get the active tab, you can use the Client API of the RadTabStrip and the get_selectedTab() method on the RadTabStrip object.

    In the attachment you can fond a simple example, which demonstrates the above suggested approach

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top