CGridView ajax update from CJuiDialog

Hi people !!

I have a CGridView inside a CJuiTabs for showing requests separated by status, so in the first tab are the request that have just arrived, in the second the accepted request in the third the rejected …

The CGridView has a couple of options to change its state. For example to accept a request I have something like this (the important part is on the click option):

'accept' => array(


                                'url' => 'Yii::app()->createUrl("problemas/moveToReviewed", array(

                                    "id" => $data->Id_Pr,




                                'options' => array('class' => 'myAcceptBtn'),


                                'visible'=>'$data->Id_Status == 1',



                                    if (!confirm('Seguro que desea cambiar su ESTADO a REVISADO ?')) {

                                        return false;



                                    $.fn.yiiGridView.update('tbl_problem_status', {  



                                        success:function(data) {


                                            alert('Aceptado con exito');



                                    return false;



wich totally works, the post request that change the row state is sent and an ajax event updates the table’s data. The table even shows its spinning wheel :)

but I have troubles when I have to update the CGridView with from a CJuiDialog the code goes like this:

'unidad' => array(

                                'label'=>'Asignar Unidad',

                                'url' => 'Yii::app()->createUrl("problemas/moveToSent", array(

                                    "id1" => $data->Id_Pr,

                                    "id2" => $data->Id_Pr,




                                'options' => array('class' => 'myUnidtyBtn'),


                                'click'=>'function() { 

                                    var id = $(this).parent().parent().find("input[name=rowid]").val();


                                    $("#txtGridProblemUrl").val( $(this).attr("href") );


                                    return false;


                                'visible'=>'$data->Id_Status == 2',


and when the user accepts the changes I have this in js code:

function changeToSentJS(){



        $.fn.yiiGridView.update('tbl_problem_status', {  


            url:"<?php echo CController::createUrl('problemas/moveToSent');?>",

            data: {id1:$("#txtGridProblemId").val()

                    , id2:$("#xtmp_select").val()

                    , cant:$("#xtmp_cant").val()


            success:function(datax) {

                $.fn.yiiGridView.update('tbl_problem_status', {data: 'id_status=2'});

                alert("Se actualizo con exito");



        return false;


I can see the POST request that changes the status of the request object and I can see the ajax get request that brings the table data without the row, but the data is not updated :(

I don’t know what to do to update the table just like with the first option…

Please, can somebody help me ?

(sorry if there are mistakes, English is not my first language)