Change the requested URL in the search grid

I am creating a form that will open in a CJuiDialog that should display a form and a CGridView to search for a record.

The grid makes the request using the same controller and action to the page where it is called.

However, I need to run another controller. How do I change the URL request of the grid?

Surely not the best solution, but got what I wanted overriding the javascript function on the grid:

$url = $this->createUrl('uf/modal');


$cs->registerScript(__CLASS__.'#'.$id,"$.fn.yiiGridView.getUrl = function(id) { return '".$url."'; };");

If anyone has a more elegant solution, please teach me.

This is a setting that should already exist on the grid.

Is a tip, developers! ;)