How to create noRecordsTemplate in MVVM?

2 posts, 1 answers
  1. Federico
    Federico avatar
    28 posts
    Member since:
    Sep 2017

    Posted 10 Oct 2017 Link to this post

    noRecords: {
        template: "nessun elemento"
      }

     

    I'd like to do this but with mvvm.

    This is my kendo grid:

     

                   <div id="a"
                       data-role="grid"
                       data-no-records="templateNoRecords"
                       data-columns="[
                                    { 'title': 'ID', 'field': 'id' ,hidden: true },
                               { 'title': 'Nome', 'field': 'nome' },
                        ]"
                       data-bind="source: products.source}">
                   <script id="templateNoRecords" name="templateNoRecords" type="text/x-kendo-template">
                       Nessun dato trovato
                   </script>
                </div>

     

  2. Answer
    Preslav
    Admin
    Preslav avatar
    516 posts

    Posted 11 Oct 2017 Link to this post

    Hello Federico,

    The correct syntax should be:

    data-no-records="{ template: 'Nessun dato trovato'}"

    For a runnable example, check my testing Dojo: http://dojo.telerik.com/AfuWi

    I hope this helps.


    Regards,
    Preslav
    Progress Telerik
    Try our brand new, jQuery-free Angular 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