Hello,
I was wondering if there is any way to solve this prob.
Every time i clic on add button it refreshes the page and I lose the inputed query in my search field. So, I have to do once again the search and it’s quite annoying (my search filter is quite big).
So, is there any solution to clic on add but without refresh the page or loosing the query ?
Thank you in advance
the view code for adding
<td style="width:10%;">
<?php $imghtml=CHtml::image(Yii::app()->baseUrl.'/images/icon_add-doc.png', 'add.jpg', array(
//'htmlOptions'=>array(
"width" => 20,
"height" => 23,
// )
));
echo CHtml::link($imghtml, array('haves/create',
'property_id'=>$data->Id,
'brochure_id'=>$_GET['brochure_id'],
'TitleName'=>$_GET['TitleName'],
'PropUnitType'=>$_GET['PropUnitType'],
'PropLocation'=>$_GET['PropLocation'],
'ProjectType'=>$_GET['ProjectType'],
'MaxFinishedYear'=>$_GET['MaxFinishedYear'],
'MinFinishedYear'=>$_GET['MinFinishedYear'],
'MinRent'=>$_GET['MinRent'],
'MaxRent'=>$_GET['MaxRent'],
'BMinRent'=>$_GET['BMinRent'],
'BMaxRent'=>$_GET['BMaxRent'],
'Pet'=>$_GET['Pet'],
'Rented'=>$_GET['Rented'],
));
?>
</td>
The controller code
public function actionCreate {
//# we can finde here the searching condition for the search filter
$modelUnit = new PropUnit('search');
$modelUnit->unsetAttributes(); // clear any default values
if(isset($_GET['PropUnit']))
$modelUnit->attributes=$_GET['PropUnit'];
if(isset($_GET['property_id']))
{
$model->property_id=$_GET['property_id'];
if($model->save())
$this->redirect(array('create',
'brochure_id'=>$model->brochure_id,
'TitleName'=>$_GET['TitleName'],
'PropUnitType'=>$_GET['PropUnitType'],
'PropLocation'=>$_GET['PropLocation'],
'ProjectType'=>$_GET['ProjectType'],
'MaxFinishedYear'=>$_GET['MaxFinishedYear'],
'MinFinishedYear'=>$_GET['MinFinishedYear'],
'MinRent'=>$_GET['MinRent'],
'MaxRent'=>$_GET['MaxRent'],
'BMinRent'=>$_GET['BMinRent'],
'BMaxRent'=>$_GET['BMaxRent'],
'Pet'=>$_GET['Pet'],
'Rented'=>$_GET['Rented'],
));
}
}