1. #1
    Sencha User
    Join Date
    Jan 2014
    Posts
    5
    Answers
    1
    Vote Rating
    0
    saminjv is on a distinguished road

      0  

    Default Unanswered: Is there a way to pin the title of a TabPanel to the top of the page?

    Unanswered: Is there a way to pin the title of a TabPanel to the top of the page?


    Hi All,
    I have a TabPanel which has a very long label inside one of its tabs (so the user has to scrolls down to see all the content), is there a way I can scroll the label not the tab? I mean instead of scrolling the whole page (which hide the title of the tabs) can I do something to pin the title of the tabs to the top of the page?

    I couldn't find any way to do so. Would be very happy if anyone can help
    Thank you in advance
    Samin

  2. #2
    Sencha User
    Join Date
    Nov 2013
    Location
    Bangalore, India
    Posts
    98
    Answers
    15
    Vote Rating
    7
    vardhan22 is on a distinguished road

      0  

    Default


    Instead of label, use HTMLPanel, and add it your tabpanel.
    See the code
    Code:
        TabPanel tabPanel = new TabPanel();
    
    
        tabPanel.add(new Label("Really short test"), "Short text");
    
    
        SafeHtml giantContent = getLongText(); 
        HTMLPanel longText = new HTMLPanel(giantContent);
        longText.getElement().getStyle().setOverflow(Overflow.AUTO);
        tabPanel.add(longText, "Long text");

  3. #3
    Sencha User
    Join Date
    Jan 2014
    Posts
    5
    Answers
    1
    Vote Rating
    0
    saminjv is on a distinguished road

      0  

    Default


    Hi vardhan22,
    Thank you for our reply, but it won't solve my problem. To me it doesn't matter what kind of widget is inside the tab (it will be more than one type), I want to pin the tab title at the top of the page, so when the user scroll down they can see the tabs and be able to switch between them without scrolling up again.

  4. #4
    Sencha User
    Join Date
    Nov 2013
    Location
    Bangalore, India
    Posts
    98
    Answers
    15
    Vote Rating
    7
    vardhan22 is on a distinguished road

      0  

    Default


    For every widget, the setOverFlow property is there. So, you can easily use that. In my opinion, there is no any direct way to pin the title of TabPanel at the top.

    You can think of some other ideas like, take ToolBar at the top of container,add buttons to it, acting as tabs. Toolbar locations will be fixed. Attach actions to change the contents of your container on button click as per requirement. This should be easy task, and it will solve your purpose

  5. #5
    Sencha User
    Join Date
    Jan 2014
    Posts
    5
    Answers
    1
    Vote Rating
    0
    saminjv is on a distinguished road

      0  

    Default


    Thank you vardhan22,

    I have to agree with you it seems there is no direct way of pinning the title of TabPanel to the top of the page. I tried so many things and yet nothing works.

Thread Participants: 1

Tags for this Thread