i checked 1000 times my code all things okey ! but after i change my theme ! its not send ajax request for filtering grid view when i checked this code i thought is okey and i should say that i searched and check wiki yii but i couldnt find my problem
my view Code:
<?php $this->widget('zii.widgets.grid.CGridView', array(
'id' => 'product-grid',
'itemsCssClass' => 'table table-bordered table-striped dataTable',
'dataProvider' => $model->notDeleted()->search(),
'filter' => $model,
'columns' => array(
'appId',
array(
'name' => 'categoryId',
'value' => '$data->category->name',
'filter' => CHtml::activeDropDownList($model, 'categoryId', CHtml::listData(Category::model()->notDeleted()->findAll(), 'id', 'name'),
array('empty' => '')
)
),
'name',
'packageName',
'price',
'discount',
'version',
array(
'name' => 'isActive',
'value' => '$data->isActive ? Yii::t("app", "Yes") : Yii::t("app", "No")',
'filter' => CHtml::activeDropDownList($model, 'isActive', array(
1 => Yii::t('app', 'Yes'),
0 => Yii::t('app', 'No'),
))
),
array(
'name' => 'inAppPurchase',
'value' => '$data->inAppPurchase ? Yii::t("app", "Yes") : Yii::t("app", "No")',
'filter' => CHtml::activeDropDownList($model, 'inAppPurchase', array(
1 => Yii::t('app', 'Yes'),
0 => Yii::t('app', 'No'),
))
),
/*
'createUserId',
'createTime',
'isDeleted',
*/
array(
'class' => 'CButtonColumn',
),
),
)); ?>
and my controller:
$model = new Product('search');
$model->unsetAttributes(); // clear any default values
if (isset($_GET['Product']))
$model->attributes = $_GET['Product'];
$this->render('admin', array(
'model' => $model,
));
please help me !
'dataProvider' => $model->search()
have you primary key in your db table? - Rohit Suthar