Hello,
I try to use the grid from Yii Bootstrap extension, but i fail.
I tried to use the CArrayDataProvider class to get the data from my table as follow in the controller :
$user_model = User::model()->findAll();
$data_provider = new CArrayDataProvider($user_model);
and then in the view :
$this->widget('bootstrap.widgets.BootGridView', array(
'type'=>'striped bordered condensed',
'dataProvider'=>$data_provider ,
'template'=>"{items}",
'columns'=>array(
...
));
But it doesn’t seem to be working because my User table is not using any ID column (username is my primary key).
So I tried with :
$data_provider = new CActiveDataProvider('User');
And that worked great !!
But I want to use the relation between the User table and the Profile table and I can’t do this with a CActiveDataProvider.
So i’m back with the CArrayDataProvider like :
$user_model = User::model()->with('profile')->findAll();
$data_provider = new CArrayDataProvider($user_model);
And again, I have this error about no ID found !
Can someone help me ?
Thanks,
Maxime.