locked
Lightswitch HTML Client VS2013 - Dynamically disable/enable screen navigation menu RRS feed

  • Question

  • Hi everyone,

    I am trying to enable or disable the screen navigation menu in a Lightswitch VS13 HTML Client dynamically.

    But I can't find the 'screen navigation element' in code (for example in the 'screen created' event of the home screen).

    It seems like the navigation menu is configured after the screen is loaded.

    I'm very thankfull for any sort of help.

    Regards

    Ilija

    Thursday, January 30, 2014 8:30 AM

Answers

  • A delay introduced like this works for me from a screen's created event handler:

        window.setTimeout(function () {
            // msls-navmenu-button class div
            var navmenus = document.getElementsByClassName("msls-navmenu-button");
            var navmenu = navmenus.item(0);
            navmenu.style.display = "none";
        }, 100);
    

    Dave


    Dave Baker | AIDE for LightSwitch | Xpert360 blog | twitter : @xpert360 | Xpert360 website | Opinions are my own. For better forums, remember to mark posts as helpful/answer.

    • Marked as answer by Tipura Ilija Thursday, January 30, 2014 6:46 PM
    Thursday, January 30, 2014 3:19 PM

All replies

  • A delay introduced like this works for me from a screen's created event handler:

        window.setTimeout(function () {
            // msls-navmenu-button class div
            var navmenus = document.getElementsByClassName("msls-navmenu-button");
            var navmenu = navmenus.item(0);
            navmenu.style.display = "none";
        }, 100);
    

    Dave


    Dave Baker | AIDE for LightSwitch | Xpert360 blog | twitter : @xpert360 | Xpert360 website | Opinions are my own. For better forums, remember to mark posts as helpful/answer.

    • Marked as answer by Tipura Ilija Thursday, January 30, 2014 6:46 PM
    Thursday, January 30, 2014 3:19 PM
  • Thank you very much.

    That is exactly what I looked for.

    Regards

    Ilija

    Thursday, January 30, 2014 6:49 PM
  • Hello.
    I have the same issue.
    I copied the code to the Screens _created methods, but I can still open the Navigation menu.
    Do you know what I am doing wrong?

    Wednesday, July 9, 2014 3:39 PM