Using external templates in MVC grid

5 posts, 0 answers
  1. Alan Mosley
    Alan Mosley avatar
    200 posts
    Member since:
    Apr 2010

    Posted 10 Feb 2015 Link to this post

    What is the equivalent to this in MVC

    rowTemplate: kendo.template($("#rowTemplate").html()),

    Thanks


  2. Dimiter Madjarov
    Admin
    Dimiter Madjarov avatar
    2195 posts

    Posted 10 Feb 2015 Link to this post

    Hello Alan,

    You could add the template in a script block and compile it in a separate one. For example:

    <script id="rowTemplate" type="text/x-kendo-template">
        ...
    </script>
    <script>
        var myTemplate = kendo.template($('#rowTemplate').html());
    </script>

    Then you could use the compiled template variable in the Grid configuration:
    .ClientRowTemplate("#=myTemplate(data)#")

    I wish you a great day!

    Regards,
    Dimiter Madjarov
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  3. Alan Mosley
    Alan Mosley avatar
    200 posts
    Member since:
    Apr 2010

    Posted 10 Feb 2015 in reply to Dimiter Madjarov Link to this post

    bingo
    Thanks
  4. Alan Mosley
    Alan Mosley avatar
    200 posts
    Member since:
    Apr 2010

    Posted 10 Feb 2015 in reply to Dimiter Madjarov Link to this post

    bingo thanks
  5. Alan Mosley
    Alan Mosley avatar
    200 posts
    Member since:
    Apr 2010

    Posted 10 Feb 2015 in reply to Dimiter Madjarov Link to this post

    bingo thanks
Back to Top