title: How can I get all IDs by grid grouping?
body: <p>I have a Kendo UI grid that is populated by Ajax query to an api.
  The grid has column for sample IDs, status (if document is generated or not) and a button to generate the document (if not already).</p>
  <p>I am implementing a button to generate documents for all sampleIds in one go and need to fetch the IDs of remaining ones.</p>
  <p>And I group the IDs based on status like this:</p>
  <pre><code>dataSource.fetch(function(){
                            var view = dataSource.view();
                            console.log(view.length);
                            console.log(view[0]);
                      });
  </code></pre>
  <p>I want to implement a function that gets all the IDs (with status 'F' ) and generate documents for them. How do I get this view array in the function?</p>
  <p>I tried this but it says datasource is undefined.</p>
  <pre><code>&lt;button id='RegenerateButton' onclick=regenerateAll()&gt;Regenerate All&lt;/button&gt;
  
  function regenerateAll(){
                  dataSource.fetch(function(){
                            var view = dataSource.view();
                           console.log(view.length);
                            console.log(view[0]);
                      });
              }
  </code></pre>
  <p>My dataSource is defined like this:</p>
  <pre><code>$(document).ready(function () {
                  var crudServiceBaseUrl = window.location.origin + &quot;/api&quot;,
                      dataSource = new kendo.data.DataSource
                      ({
                          type: &quot;json&quot;,
                          serverPaging: true,
                          serverSorting: true,
                          serverFiltering: true,
                          allowUnsort: true,
                          pageSize: 10,
                          group:{field:&quot;Status&quot;},
                          transport: {
                              read: {
                                  url: crudServiceBaseUrl + &quot;/HL7Message/getListOfProcessedData/&quot;,
                                  dataType: &quot;json&quot;,
              
  .....
  </code></pre>