title: How can I find length of kendo dataSource?
body: <p>I am trying to find length of kendo grid dataSource, but I am always getting 0 in return. How can I get the total length of dataSource? I have added Control service that is dataSource for the grid. </p>
  
  <p>ctrl.js</p>
  
  <pre><code>  $scope.alignedProcessesToControlGridOptions.dataSource = ControlRatingGridDataService.getAlignedProcessesToControlGrid($stateParams.controlId);
    var data = $scope.alignedProcessesToControlGridOptions.dataSource.data().length;
    console.log('GRID DATA', data);
  </code></pre>
  
  <p>DataService.js</p>
  
  <pre><code>getAlignedProcessesToControlGrid: function(controlKey) {
      var countNew = 0;
      return new kendo.data.DataSource({
          type: 'json',
          serverPaging: true,
          serverSorting: true,
          serverFiltering: true,
          transport: {
              read: function(options) {
                  var gridSearchObject = {
                      skip: options.data.skip,
                      take: options.data.take,
                      pageSize: options.data.pageSize,
                      page: options.data.page,
                      sorting: options.data.sort,
                      filter: options.data.filter
                  };
                  return $http.post(
                      'app/control/rest/allAlignedProcessesToControl/' + controlKey, gridSearchObject).success(
                      function(data) {
                          countNew = data.totalCount;
                          options.success(data.resultDTOList);
                      });
              }
  
          },
          pageSize: 5,
          schema: {
              model: {
                  id: 'riskInProcessKey',
                  fields: {
                      processName: {
                          editable: false
                      },
                      epcfName: {
                          editable: false
                      },
                      erhName: {
                          editable: false
                      },
                      ctlGeolocationsText: {
                          editable: false
                      },
                      ctlPerformanceRatingText: {
                          editable: false
                      },
                      ctlEffectivenessRatingText: {
                          editable: false
                      }
                  }
              },
              total: function() {
                  return countNew;
              }
          }
      });
  },
  </code></pre>