Make asynchronous method refreshContent of grid.

I have the following ajax script.
$.ajax({
  url: url,
  type: "DELETE",
  dataType: "text",
  success: function (data) {
    var grid = $('#rolesgrid').ejGrid("instance");
    grid.refreshContent();
    $('#rolesgrid_delete').css('visibility', 'hidden');
    renameConditionType(grid);     
  },
  error: function (xhr, textStatus, errorThrown) {
    showDialogMessage('Page error', errorThrown, 'danger');
  }  
});
Method renameConfitionType change content of last column.
function renameConditionType(grid){
        var gridRows = grid.getRows();
        var columnIndex = grid.getColumnIndexByField("ConditionType");
        for (var i = 0; i < gridRows.length; i++) {
            if (gridRows[i].children[columnIndex].innerHTML === '1'){
                $(gridRows[i].children[columnIndex]).html('AND');
            }
            else if (gridRows[i].children[columnIndex].innerHTML === '0'){
                $(gridRows[i].children[columnIndex]).html('OR');
            }  
        }
    }

When I make request by calling function grid.refreshContent(). The next function renameConditionType(grid) is called. This second change context of specific column.

When request from function grid.refreshContent() is finished. It overwrites the result of function renameConditionType(grid).

How to make in order to wait when request from function grid.refreshContent(). I use syncfusion javascript grid.




1 Reply

TS Thavasianand Sankaranarayanan Syncfusion Team February 21, 2018 11:40 AM UTC

Hi Maciej, 

Thanks for contacting Syncfusion support. 

We have analyzed your query and we have prepared a sample based on your given code example. We suspect that you want to replace some values in particular cell based on the previous value. But we are able to change the cell value based on your given code example and we have done the process in an external button click event. We are unable to reproduce the reported issue from our end.  

We have prepared a sample and it can be downloadable from the below location. 


Please provide the following details for better assistance. 

  1. Share screen shot or video demonstration of the issue.
  2. Share full Grid code example.
  3. Share Essential Studio version and browser version details.
  4. If possible share the sample or reproduce the issue in the attached sample.  

Regards, 
Thavasianand S. 


Loader.
Up arrow icon