I am a Yii-Newbie and not familiar with Ajax.
I tried pagination using CLinkPager in a multimodelform (tabular input). The pagination works, I am able to browse through the datatable but I see, that each page is loaded as a new site request from the server and not as Ajax request.
But I want to make the pagination in the way of Yii-CGridView - using Ajax for loading the data-pages.
Please can anyone give me a simple example how to manage this without using CGridView. I render the view using the widget MultiModelForm, this is a Yii extension.
The controller is like this:
public function actionMultiModelForm() {
Yii::import('ext.multimodelform.MultiModelForm');
$model = new Noten();
$validatedMembers = array();
if(isset($_POST['Noten']))
{
$model->attributes=$_POST['Noten'];
MultiModelForm::save($model,$validatedMembers,$deleteMembers);
}
$this->render('multiModelForm',array(
'model' => $model,
'validatedMembers' => $validatedMembers,
));
}
Part of the view:
$criteria = $model->search()->criteria;
$count=$model->count($criteria); echo $count;
$pages=new CPagination($count);
$pages->pageSize=8;
$pages->applyLimit($criteria);
$this->widget('ext.multimodelform.MultiModelForm',array(
'id' => 'id_member', //the unique widget id
'formConfig' => $formConfig, //the form configuration array
'model' => $model, //instance of the form model
'tableView' => true,
'validatedItems' => $validatedMembers,
'data' => $model->findAll($criteria),
));
?>
<div class="row buttons">
<?php echo CHtml::submitButton($model->isNewRecord ? 'Create' : 'Save'); ?>
</div>
<?php $this->endWidget(); ?>
Thank you for tips.