Am trying to bring a tab view with list , sorting and pagination in Yii. I have 2 tables named service_request and favourites where the datas come from. In that page I need to display the service request and favourites added date and some other fields. I tried to implement it with join , but it is not successfully listing the datas from service request. In my controller action I had added
$criteria = new CDbCriteria;
$criteria->select = 'favourite_notes,s.service_request_id';
$criteria->join = 'LEFT JOIN service_request s ON service_request_id = 1';
$criteria->condition = 'favourite_type = 1';
$data=new CActiveDataProvider('ProviderFavourite',array('criteria'=>$criteria,'pagination'=>array('pageSize'=>1)
));
$this->renderPartial('viewtest', array(
'ModelInstance' => ProviderFavourite::model()->findAll($criteria),
'dataProvider'=>$data,
));
In viewtest I had provided,
$this->widget('zii.widgets.CListView', array('dataProvider'=>$dataProvider,'itemView'=>'view',
'id'=>'request-list',
'template' => ' {items}{pager}',
));
In view page, I had fetched the data
echo $data->service_request;
echo $data->favourite_notes;
All your suggestions are welcome..