Issue
I have gridview with filters+checkboxes like below:
Gridview is filtered when checkbox is checked and its working v. nice but when i'm clicking on the column name to sort columns sort is taking controll over the filters and they just stop working...
I cant even unclick checkboxes and change values in filters inputs cause "sort" keeps values from before i clicked column name.
Is there any way to repair this?
My search function in model looks like below:
public function Search(): CActiveDataProvider
{
$request = Yii::app()->request;
$requestusr = $request->getParam('Users');
$this->xyz_name_filter = isset($requestusr['xyz_name_filter']) ? $requestusr['xyz_name_filter'] : 1;
$this->xyz_surname_filter = isset($requestusr['xyz_surname_filter']) ? $requestusr['xyz_surname_filter'] : 1;
$this->xyz_street_filter = isset($requestusr['xyz_street_filter']) ? $requestusr['xyz_street_filter'] : 0;
$criteria = new CDbCriteria();
$this->xyz_name_filter == 1 ? $criteria->compare('t.xyz_name', $this->xyz_name, true) : null;
$this->xyz_surname_filter == 1 ? $criteria->compare('t.xyz_surname', $this->xyz_surname, true) : null;
$this->xyz_street_filter == 1 ? $criteria->compare('t.xyz_street', $this->xyz_street, true) : null;
return new CActiveDataProvider(
$this, array(
'criteria' => $criteria,
'pagination' => array(
'pageSize' => $this->pagesize,
),
)
);
}
Thanks for reply.
Solution
The problem wos in config... adding line:
'admin/<lang:[a-z]{2}>/<controller:\w+>/<action:\w+>'=>'admin/<lang>/<controller>/<action>'
solves the problem.
Answered By - TomLi
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.