This is a migrated thread and some comments may be shown as answers.

How to change current rowTemplate to "No records found" template?

0 Answers 66 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Pavlik
Top achievements
Rank 1
Pavlik asked on 26 Jul 2012, 10:08 AM
Hello.

I have such rowTemplate for output my data into the grid:
<script id="row_template" type="text/x-kendo-tmpl">
<tr>
        <td>
            #= UserName #
        </td>
        <td>
            #= FirstName #
        </td>
        <td>
            #= LastName #
        </td>
</tr>
</script>

And I prepared another template if records is not found:
<script id="empty_row" type="text/x-kendo-tmpl">
    <tr>
        <td colspan="7">No records found</td>
    </tr>
</script>

And I need to do some changes between this templates. I mean assign this "empty_row" to the grid when "no records found":
$("table.kendo_grid").kendoGrid({
dataSource: {
  transport: {
  ...
  },
  schema: {
  ...
  },
  change: function (data) {
    if (data.sender.total() == 0) {
       // What I need to write here?
    }
  },
...

Need help.
Thanks.

No answers yet. Maybe you can help?

Tags
Grid
Asked by
Pavlik
Top achievements
Rank 1
Share this question
or