locked
[HTML Client, VS2013.2] is there a better way to bind URL Viewer link text? RRS feed

  • Question

  • I have a URL field declared as a web address and exposed as a URL Viewer control in a table.

    I don't see how I can bind the link text to something different through the designer, so I've added a postRender.  It seems to work ok, but the performance isn't great, as I can see the column populating for a few seconds after the rest of the page has loaded fine.

    myapp.ThePage.Column_URL_postRender = function (element, contentItem) {
        contentItem.dataBind("data.Site.DisplayName", function (value) {
            $(element).find('a').text(value);
        });
    };

    Is there a better way of doing this? Since the 'element' seems to be the wrapping <td> element, doing the find to get the actual link seems to be necessary.  I could avoid using jQuery, but this seems like it's hopefully less fragile.

    Thanks!

    Thursday, June 19, 2014 8:06 PM