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.
$.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;
<div data-options="dxView : { name: 'dd',disableCache: true } " >
<div data-bind="dxCommand: { icon: 'refresh', id: 'save', onExecute: refresh }"></div>
<div data-options="dxContent : { targetPlaceholder: 'content' } " >
<div id="gridContainer"></div>
</div>
</div>