How do I hide the footer on some views?

3 posts, 1 answers
  1. Stewart
    Stewart avatar
    37 posts
    Member since:
    Oct 2013

    Posted 22 Oct 2013 Link to this post

    I have a page footer which I want to show on all views other than the "home" view when I am asking the user to login (so don't want to show the navigation options). Is this possible using a layout and views?

    The code I have for the layout section is as follows, where you can see I use "data-bind="visible: isLoggedIn" - which works correctly in views, but doesn't work here. Any suggestions, please?

    <!--Layout-->
            <div id="tabstrip-home"
                data-role="layout"  
                data-id="tabstrip-layout"
                data-model="app.loginService.viewModel">

                <!--Header-->
                <div data-role="header" style="background-color: white">
                    <div data-role="navbar">
                        <span data-role="view-title"></span>
                    </div>
                </div>

                <!--Footer-->
                <div data-role="footer" data-bind="visible: isLoggedIn">
                    <div data-role="tabstrip">
                        <a href="#tabstrip-wall" data-icon="contacts">Wall</a>
                        <a href="#tabstrip-agenda" data-icon="contacts">Agenda</a>
                        <a href="#tabstrip-workshops" data-icon="search">Workshops</a>
                        <a href="#tabstrip-hospitality" data-icon="globe">Hospitality</a>
                        <a href="#tabstrip-home" data-icon="globe">Log out</a>
                    </div>
                </div>
            </div>

    Thanks!
    Stewart
  2. Answer
    Steve
    Admin
    Steve avatar
    10941 posts

    Posted 23 Oct 2013 Link to this post

    Hello Stewart,

    data-bind would work only if the footer is part of the view and in your case it is in the layout. The model applies only to the view. Move it to a view and the binding would work. If you want to keep a common footer, you can hide it manually whenever needed, the visible binding only sets display:none.

    Regards,
    Steve
    Telerik
    You've missed the Icenium Visual Studio Integration keynote? It has been recorded and posted here.
    Looking for tips & tricks directly from the Icenium team? Check out our blog!
    Share feedback and vote for features on our Feedback Portal.
  3. Stewart
    Stewart avatar
    37 posts
    Member since:
    Oct 2013

    Posted 23 Oct 2013 Link to this post

    Thanks Steve. That's what I figured.
Back to Top