AngularJS Function to HTML

2 posts, 0 answers
  1. Danny
    Danny avatar
    3 posts
    Member since:
    Dec 2014

    Posted 11 Oct 2016 Link to this post

    I am trying to create a function that changes the awesome icon before the test based on what the text is.

    I can't get it to read the html from the return. I have attach an image of what I am trying to create.

    field: "ProductName", title: "Status", template: " {{ setStatus(dataItem.ProductName) }} #=ProductName# "


     $scope.setStatus = function(name) {            
                if (name === 'Chai') {
                    return "<i class='fa fa-check-circle' style='color:green; font-size: 150%'></i>";
                else if (name === 'Chang') {
                    return "<i class='fa fa-times-circle' style='color:red; font-size: 150%'></i>";

  2. Stefan
    Stefan avatar
    2746 posts

    Posted 13 Oct 2016 Link to this post

    Hello Danny,

    I can assume that the issue is caused by the used format of the template and the called function inside it.

    Please check more information for the columns.template of the Kendo UI Grid:

    Additionally, I made a Dojo example based on provided code and it is working as expected:

    I hope this is helpful.

    Telerik by Progress
    Get started with Kendo UI in days. Online training courses help you quickly implement components into your apps.
Back to Top