Search code examples
javascriptcssvisual-studiovisual-studio-lightswitchlightswitch-2013

Lightswitch 2013 HTML Client - change background on one screen rather than all


I know this will be possible but I have been unable to work this out so far... will this be done within the screen created code on the screen or is there a specific file I need to look in to achieve my goal?

thanks


Solution

  • Remember that HTML5 screens are built on Jquerymobile, so they also have the inherited richness of the Jquery selector model.

    So... if you go to your designer, highlight the group control just below the TAB and click on the Edit PostRender Code link in the properties screen, you can add something like this:

    myapp.ViewBook.Details_postRender = function (element, contentItem) {
        // Write code here.
        $(element).parent().parent().css({ background: '#FFDFDF' });
    };
    

    You could probably also edit other CSS styling elements in the same place.