Well, it is pretty much as it states in the title. I have a CGridView setup. I enter a filter into one of the fields and tab away to initiate the filter. However, rather than filtering, it seems to just clear the text I entered. The little "working" graphic appears briefly as if it is trying to do something. Any ideas what is going on?
Model:
public function rules() {
return array( array('nPublisherID, nOrderID, dateFulfilled, strTitle, strFirstName, strLastName, curAmount', 'safe', 'on'=>'search'),
);
}
public function search() {
$criteria=new CDbCriteria;
$criteria->compare('nOrderID', $this->nOrderID);
$criteria->compare('dateFulfilled', $this->dateFulfilled);
$criteria->compare('curAmount', $this->curAmount);
$criteria->compare('strTitle', $this->strTitle, true);
$criteria->compare('strFirstName', $this->strFirstName, true);
$criteria->compare('strLastName', $this->strLastName, true);
return new CActiveDataProvider($this, array(
'criteria'=>$criteria,
'pagination'=>array('PageSize'=>10),
));
}
Controller:
public function actionAdmin() {
$model=new Publisher_R('search');
$model->unsetAttributes(); // clear any default values
if(isset($_GET['Publisher']))
$model->attributes=$_GET['Publisher'];
$this->render('admin',array(
'model'=>$model,
));
}
View:
$this->widget('CGridView', array(
'id'=>'report-grid',
'dataProvider'=>$model->search(),
'filter'=>$model,
'attributes'=>array('id'=>'nOrderID'),
'columns'=>array(
array('name'=>'nOrderID', 'htmlOptions'=>array('width'=>70)),
array('name'=>'dateFulfilled', 'htmlOptions'=>array('width'=>120)),
array('name'=>'curAmount', 'htmlOptions'=>array('width'=>70)),
array('name'=>'strTitle', 'htmlOptions'=>array('style'=>'text-align: left')),
array('name'=>'strFirstName', 'htmlOptions'=>array('width'=>80)),
array('name'=>'strLastName', 'htmlOptions'=>array('width'=>80)),
),
));