locked
lightswitch html client postrender RRS feed

  • Question

  • Dear Support,

    I am trying to display the "EmailBody" which is basically an html document stored and display it to a custom control but i am getting the following error:

    myapp.ViewCampaign_BulkEmail.ScreenContent_render = function (element, contentItem) {
        // Write code here.
        // var pageName = contentItem.screen.details.displayName;
        var bodyhtml = contentItem.screen.Campaign.EmailCampaigns.first().EmailBody; 
        element.innerHTML = bodyhtml;
    };

    Friday, July 24, 2015 5:17 PM

Answers

  • Hi tsiakk,

    Could you please give us the detailed error message? Please check the value of bodyhtml that you have got whether it is a standard html document format.
    Following code shows a custom control render by a html document of EmailBody. I set the body as an <a></a> and it display correct as below image.

    myapp.BrowseValidates.EmailBody_render = function (element, contentItem) {
        var bodyhtml = "<html><body><div><a herf=\"#\">EmailBody</a></div></body></html>";
        element.innerHTML = bodyhtml;
    };

      




    Best Regards,
    Weiwei

    • Marked as answer by Angie Xu Monday, August 3, 2015 6:32 AM
    Friday, July 31, 2015 1:21 AM
    Moderator