Hi!
I have 2 CGridViews into a view:
1- Unassigned cars.
2- Assigned cars.
Unassigned cars grid have this button:
...
'buttons'=>array(
'assignCar'=> array(
'label' => '<span class="glyphicon glyphicon-chevron-left"></span>',
'url'=>'Yii::app()->createUrl("controller/assigCar")',
'options'=>array(
'title' => 'Asign Car',
'ajax'=>array(
'type'=>'POST',
'url'=>"js:$(this).attr('href')",
'success' => 'function (data)
{
// If there were no errors
$.fn.yiiGridView.update("unassigned-cars-grid");
$.fn.yiiGridView.update("assigned-cars-grid");
}'
),
),
),
),
...
This works correctly. Unassigned car happens to be assigned and both grids update correctly, and current page in the web browser doesn’t change.
Assigned car grid have the same button (called "unassignCar"), but with:
'url'=>'Yii::app()->createUrl("controller/unassignCar")',
This works correctly too, but page displayed in the web browser is "Yii::app()->createUrl(controller/unassigCar")" and not the current page.
Someone can help me?
Thanks!