Get the value of a value in the widgets CgridView

Get the value of a value in the widgets CgridView

Good night I'm trying to capture the id of a row cdesde a CgridView I hope they can help me any suggestions I'll be grateful, regards

Function that calls the window where the CgridView is located

  1. <script >
     
    function buscarArticulo() {
     window
    .open("../articulo/catInventario", "popupId", "location=no,menubar=no,titlebar=no,resizable=no,toolbar=no, menubar=no,width=500,height=500");
     
    }
     
    </script>
This is the function in the popup window:
  1. <script language="javascript">
    function cerrar(idarticulo) {
    window
    .opener.document.getElementById('idarticulo').value = <?php echo $model->idarticulo; //the new id ?>
    window
    .close();
    }
    </script>
This is the CgridView widget:
  1. <?php $this->widget('zii.widgets.grid.CGridView', array(
           
    'id'=>'catInventario-grid',
           
    'dataProvider'=>$model->search(),
           
    'filter'=>$model,
           
    'columns'=>array(
                   
    'idarticulo',
                   
    'codigo',
                   
    'nombre',
                   
    'descripcion',
                   
    'imagen',
                   
    'uso_interno',
                   
    /*
                    'idcategoria',
                    'idpresentacion',
                    'cod_impuesto',
                    */

                    array
    (
                           
    'class'=>'CButtonColumn',
                           
    'template'=>'{elegir}',
                           
    'buttons'=>array(
                                   
    'elegir'=>array(
                                           
    'click'=>'cerrar',
                                           
    ),

                                   
    ),

                   
    ),
           
    ),
    )); ?>
This is the model, where is the search for the complete search
  1. public function search()
           
    {
                   

                    $criteria
    =new CDbCriteria;

                    $criteria
    ->compare('idarticulo',$this->idarticulo);
                    $criteria
    ->compare('codigo',$this->codigo,true);
                    $criteria
    ->compare('nombre',$this->nombre,true);
                    $criteria
    ->compare('descripcion',$this->descripcion,true);
                    $criteria
    ->compare('imagen',$this->imagen,true);
                    $criteria
    ->compare('uso_interno',$this->uso_interno,true);
                    $criteria
    ->compare('idcategoria',$this->idcategoria);
                    $criteria
    ->compare('idpresentacion',$this->idpresentacion);
                    $criteria
    ->compare('cod_impuesto',$this->cod_impuesto,true);

                   
    return new CActiveDataProvider($this, array(
                           
    'criteria'=>$criteria,
                   
    ));
           
    }
And this is the controller function:
  1. public function actionCatInventario()
  2.         {
  3.                 $model=new Articulo('search');
  4.                 $model->unsetAttributes();  // clear any default values
  5.                 if(isset($_GET['Articulo']))
  6.                         $model->attributes=$_GET['Articulo'];

  7.                 $this->render('catInventario',array(
  8.                         'model'=>$model,
  9.                 ));
  10.         }
As you realize, it is for a web expenses form and for this sense I only need the idarticle, I hope to have been clear and they can help me, thank you very much for your time