Custom tab action

2 posts, 0 answers
  1. Decisive Computing
    Decisive Computing avatar
    18 posts
    Member since:
    Mar 2015

    Posted 25 May 2017 Link to this post

    Is it possible to customize how a tab acts when clicked? For instance, I would really like to include a "More" tab that displays the side drawer instead of actually switching to a new tab.

    I have tried leaving the tab's Content null. I have also tried subscribing to the tab header's Tapped event - which fires, but only after the tab is selected.

    Even having access to add controls to the Header would help.

    Any thoughts?

  2. Petar Marchev
    Petar Marchev avatar
    1029 posts

    Posted 26 May 2017 Link to this post

    Hi Brian,

    Unfortunately there is no out-of-the-box feature that will allow you to do exactly this.

    There is an easy way to attach a handler for the Tapped event of the overflow button (via the OverflowButtonTemplate). However, even if you were to attach a Tapped handler and opened the side drawer, you cannot prevent the popup from opening.

    One way to go here is to overlay a custom button on top of the TabView. You can place this custom button in the top right corner of the TabView. This way the user will not be able to see or click the TabView's overflow button, but only the custom one. In its Tapped handler you can open the side drawer. I am attaching a demo code I tested with.

    Note that the work-around is essentially to set the same size to the TabView's overflow button and the custom button, so that the custom button does not overlap the tab items, and so that the user cannot interact with the TabView's overflow button.

    There is one thing worth mentioning here - in case all tab items fit in the given area, the TabView's overflow button will not be displayed, but the custom one will be, leading to it overlapping the tab items. If at times you expect this to happen, i.e. the TabView not to have many tab items and the TabView's overflow button not to be displayed all the time, I could investigate if there is a way to detect when the button gets collapsed.

    I have logged your inquiry as a feature request in our feedback portal. Here you can track its status and vote. I have updated your Telerik points as a thank you for giving us a great idea on how to improve our products.

    Let me know if I was able to address all that interest you and if you need more information.

    Petar Marchev
    Progress Telerik
    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