Problem with CGridView updateButton and deleteButton

Hi there,

I’m facing a problem with CGridView update and delete button.

Actually I’ve configured delete and updateButtonUrl as




$this->widget('zii.widgets.grid.CGridView', array(

    ...

    'columns' => array(

        array(

                 'class' => 'CButtonColumn',

                 'header' => 'Action',

                 'template' => '{update} {delete}',

                 'updateButtonUrl' => '__URL__."/update/" . $data->primaryKey',

                 'deleteButtonUrl' => '__URL__."/delete/" . $data->primaryKey',

        ),

    ),

));



URL I found after page load for update button is:

http://localhost/npr...iners/update/11

[b]But after Ajax refresh/reload of CGridView url changes as:[b]

[i]http://localhost/npr...s-grid/update/6[i]

How can I solve this problem. I want it to be always like http://localhost/npr...iners/update/11

THANKS IN ADVANCE

Have you tried something like this?


'deleteButtonImageUrl'=>Yii::app()->request->baseUrl."/img/delete.png",

The urls you are getting after the AJAX is visible on the address bar ?

In general ajax calls are made with a POST and those additions are the values of the sort order and/or filter input values… so they should be in the link… but as that is a POST call they should not be in the address bar.