Hi
I think I messed up my Yii app some how.
I’m not able to search for records thru the filter fields (the row just underneath the heading). The ajax loading icon apears but nothing happens.
This happens to all my CGridViews.
Im sure I’ve done something to mess it up, but I have no clue what I’ve done :S
I’ve tried to do a var_dum in Search method, but it seems it never reaches the function.
The standard Advanced Search do work thou.
See attached image.
4231
The one thing I’ve done different is to replace my Index action code with Admin action code.
My search js:
Yii::app()->clientScript->registerScript('search', "
$('.search-button').click(function(){
$('.search-form').toggle();
return false;
});
$('.search-form form').submit(function(){
$.fn.yiiGridView.update('user-grid', {
data: $(this).serialize()
});
return false;
});
");
Here is the decleration of CGridView in the same file
<?php $this->widget('zii.widgets.grid.CGridView', array(
'id'=>'user-grid',
'dataProvider'=>$model->search(),
'filter'=>$model,
'columns'=>array(
'UserName',
'Password',
'Active',
'API',
'APIKey',
array(
'class'=>'CButtonColumn',
),
),
)); ?>
The search method is standard
public function search()
{
// Warning: Please modify the following code to remove attributes that
// should not be searched.
$criteria = new CDbCriteria;
$criteria->compare('Id',$this->Id);
$criteria->compare('UserName',$this->UserName,true);
$criteria->compare('Password',$this->Password,true);
$criteria->compare('Active',$this->Active);
$criteria->compare('API',$this->API);
$criteria->compare('APIKey',$this->APIKey,true);
$criteria->compare('LanguageId',$this->LanguageId,true);
$criteria->compare('Email',$this->Email,true);
$criteria->compare('Status',$this->Status);
$criteria->compare('CreatedDateTime',$this->CreatedDateTime,true);
$criteria->compare('CreatedBy',$this->CreatedBy);
$criteria->compare('ModifiedDateTime',$this->ModifiedDateTime,true);
$criteria->compare('ModifiedBy',$this->ModifiedBy);
$t = new CActiveDataProvider($this, array(
'criteria'=>$criteria,
));
return new CActiveDataProvider($this, array(
'criteria'=>$criteria,
));
}
Does anyone know where I can start looking?