I have a kendo grid, and I want to change the row color everytime the ajax call is under execution. For that, I created a javascript function, wich works well, and this function changes the row color before ajax success.

```
function runCommand(command) {
    //Selecting Grid
    var gview = $("#grid").data("kendoGrid");
    //Getting selected rows
    var rows = gview.select();
    var rowOldClass;
    if (rows.size() == 0) alert("Please select an area");
    else {
        //Iterate through all selected rows
        rows.each(function (index, row) {

            // Get an item
            var selectedItem = gview.dataItem(row);

            // Call the API Controler to start the command on the selected area
            var params = {
                AreaId: selectedItem.Id,
                Command: command
            };
            var areaName = selectedItem.Name;
            $.ajax({
                type: 'POST',
                url: 'myapi',
                data: JSON.stringify(params),
                dataType: 'json',
                contentType: "application/json",

                beforeSend: function () {
                    //Change row color
                    var row = $("#grid").data("kendoGrid")
                               .tbody
                               .find("tr[data-uid='" + selectedItem.uid + "']");

                    // Set the background Color to yellow
                    row.css("background-color", "#FDB913");
                },
                success: function (data) {
                    // Put the result into the output textarea
                    var result = $("#output").val();
                    $("#output").val(result+"\n"+data);
                    //A trick to go back to the previous css
                    selectedItem.set("Name", "");
                    selectedItem.set("Name", areaName);
                }
            }).fail(function () {
                alert("error: cannot execute the command.");
                //A trick to go back to the previous css
                selectedItem.set("Name", "");
                selectedItem.set("Name", areaName);
            });
        });
    }
}

```

So as you can see, I use these two lines to go back in the previous status after changing the color of the row.

```
selectedItem.set("Name", "");
selectedItem.set("Name", areaName);

```

The problem with my function is that when I run multiple actions on multiple areas, I want every row to hang on it's previous color without refreshing (yellow color) and then go back to the default color only if the AJAX call is finished. And with this current implementation, when I run multiple AJAX calls on different rows, the first row that finishes it's AJAX call **will update all the grid** which is inacceptable because I want only the row that finished the AJAX call to be updated, not all the grid because updating the grid, will cause all the rows to be updated.
Is there any solution to this problem ? Thank you!