Hello.
I have a bit complicated structue here. In two words: the front page with some administrative tools inside floating div.
It’s made of preloaded empty div in main layout which gets contents via ajaxLink that sending request to a module and puts contents into this div.
The module’s view only renders some ajaxLinks to different tools: users management, group management etc. This links updates current div without page beign refreshed. Links are getting content from another views of the same module.
Module’s controller:
class IndexController extends Controller {
public function actionIndex() {
$this->renderPartial('index',null,false,true);
}
public function actionUsers() {
$model = new Users('search');
$this->renderPartial('users',array(
'model' => $model,
));
}
...
}
I have a problem with CGridView. Links inside this widget forcing page to reload, and I need only reload div contents.
Here’s the view:
<div id="users-grid">
<?php
$this->widget('zii.widgets.grid.CGridView', array(
'dataProvider' => $model->search(),
'filter' => $model,
'columns' => array(
array(
'name' => 'name',
'type' => 'raw',
'value' => 'CHtml::encode($data->name)'
),
array(
'name' => 'email',
'type' => 'raw',
'value' => 'CHtml::link(CHtml::encode($data->email), "mailto:".CHtml::encode($data->email))',
),
array(
'class'=>'CButtonColumn',
),
),
));
?>
</div>
Since I set processOutput of actionIndex of the module to true, I get no css or js with grid. That’s fine. All styles I need are stored in the layout, but may be it’s a reason for ajax that’s not works right.
So, is there a way to make paginator and other links to be ajaxLinks?