title: How can I set the total number of data items in my grid using a function?
body: <p>I've tried various ways to set the total number of records in the <code>Kendo-UI Web Grid</code>, without success.</p>
  
  <p>I'm kind of lost on where I spend the amount processed in ajax, already assigns the total value in the schema for 4 to see if it happens more paging did not work, just shows the two records and it shows that there are more pages.</p>
  
  <p>If anyone could help me I would be very grateful!</p>
  
  <pre class="lang-js prettyprint-override"><code>...
  transport: {
      read: function (option) {
         $.ajax({
         url: '&lt;?=$view-&gt;encode('ctrl.php?turma=lista_turma');?&gt;',
         data:{
            skip: option.data.skip,
            take: option.data.take,
            pageSize: option.data.pageSize,
            page: option.data.page,
            sorting: JSON.stringify(option.data.sort),
            filter: JSON.stringify(option.data.filter)
         },
         success: function (result) {
             option.success(JSON.parse(result));
         },
         error: function (result) {
            alert(result);
         }
      },
      schema: {
         data: 'data',
         total: function (data) {
             return 4;
         },
         /*total: function (result) {
            alert('aqui');
            result = result.d || result;
            return 4;
         },*/
         model: { id: "id_turma" },
            fields: {
               id_turma: { validation: { required: true } },
               nome_turma: { validation: { required: true } },
               sigla_turma: { validation: { required: true, max:12 } }
            }
            }
         },
         pageable: true,
         serverPaging: true,
         serverFiltering: true,
         serverSorting: true,
         batch: true,
         pageSize: 2
  });
  </code></pre>