Failed To Select Row After Update The Grid

I am using gridview in yii and a form on top of grid view so that when update button is clicked it will show the value on the form. I can highlight the row after update button is clicked using this javascript

function updateDetail(url) {


            function(data) {









                $('#mySubmitButton').html('<i class="icon-ok icon-white"></i> Simpan');


                var rowId = "#row-" + $('#TransactionDetail_id').val();

                var curRow = $(rowId).get(0);




The last row can make the row is selected (highlighted). However, when I am finish with updating, I have difficulty to highlight the last updated row. Using code below,

function formDetailSaved(data) {

    if (data.status == "success") {








        $('#mySubmitButton').html('<i class="icon-plus icon-white"></i> Tambah');

        var rowId = "#row-" + $('#TransactionDetail_id').val();

        $('html,body').animate({scrollTop: ($(rowId).offset().top - 100)}, 500);

        // delete id to reset update


        toastr.success(data.message, data.title);

        var curRow = $(rowId).get(0);


    } else {

        toastr.error(data.message, data.title);




From Firebug I can see that the row is selected but somehow it is being refresh again. Hence, the selected is removed. Any one can help on this? The idea is to show which row has been updated since I am not using pagination and the row can be 100-200.

Thank you in advance.