Answer the question
In order to leave comments, you need to log in
How to specify dataProvider when using TbGridView yii-booster addon?
The selection from the database is:
$data = Players::model()->findAll('Member=:Member',array(':Member'=>5));
Answer the question
In order to leave comments, you need to log in
So drag the data provider from the database
$criteria = new CDbCriteria;
$criteria->compare('Member', 5);
$dataProvider = new CActiveDataProvider('Player', array(
'criteria' => $criteria,
'pagination' => false
));
'dataProvider'=>$model->search(),
'filter'=>$model,
$model=new Model('search');
$model->unsetAttributes(); // clear any default values
if (isset($_GET['Model']))
$model->attributes = $_GET['Model'];
if (isset($_GET['ajax']))
{
$this->renderPartial('_modelgrid',array(
'model'=>$model,
));
Yii::app()->end();
}
else
$this->render('index',array('model'=>$model));
return new CActiveDataProvider($this, array(
'criteria'=>$criteria,
));
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question