title: dxDataGrid - How to refresh the widget
body: <p>When ı clicked button, not working refresh.If the purpose is to add to the database buton button press to come to the screen. But is not updating. I created a datagrid with ajax. I also wrote the refresh function in ViewModel.What may be the reason for not renewing. My data is json.</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>$.ajax({
          type: "GET",
          url: "https://js.devexpress.com/Demos/WidgetsGallery/data/orderItems"
          success: function (msg, result, status, xhr) {
          var obj = jQuery.parseJSON(msg);
          $("#gridContainer").dxDataGrid({
          dataSource: obj,
          filterRow: {
          visible: true}});}});
          var viewModel = {
          refresh: function () {        
          var dataGrid = $('#gridContainer').dxDataGrid('instance');
          dataGrid.refresh();}};
  return viewModel;</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;div data-options="dxView : { name: 'dd',disableCache: true } " &gt;
     &lt;div data-bind="dxCommand: { icon: 'refresh', id: 'save', onExecute: refresh }"&gt;&lt;/div&gt;
       &lt;div  data-options="dxContent : { targetPlaceholder: 'content' } " &gt;
         
           &lt;div  id="gridContainer"&gt;&lt;/div&gt; 
          
              &lt;/div&gt;
  &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>