Custom field template is not working as expected

2 posts, 0 answers
  1. Milan
    Milan avatar
    4 posts
    Member since:
    Apr 2017

    Posted 11 Apr Link to this post

    Hello,

    I'm trying to solve problem with rendering objects, I've found a solution using custom template for field.

    My code:

    $interprets = new \Kendo\UI\GridColumn();
           $interprets
               ->field('interprets')
               ->template('#
               var template = "<ul>";
       for (var i = 0; i < interprets.length; i++) {
           template = template + "<li>" + interprets[i].contact.name+ "</li>";
       }
     
       return template + "</ul>";
    #')
               ->title('interprets');

    But the result is not what I expected, it can be seen on screenshot attached.

    Can you please tell me, how to solve this issue?

    Thanks a lot

     

  2. Viktor Tachev
    Admin
    Viktor Tachev avatar
    1768 posts

    Posted 13 Apr Link to this post

    Hi Milan,

    By default the <li> HTML elements will have a dot placed before them. If you would like to remove it you would need to add the following CSS to the page.

    ul {
      list-style-type: none;
    }


    Regards,
    Viktor Tachev
    Telerik by Progress
    Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Back to Top