new Model question

Hello, in the controller initialization for a lot of actions it sets the model via:




$model=new ABC('search');

$model->unsetAttributes();  // clear any default values

if(isset($_GET['ABC']))

      $model->attributes=$_GET['ABC'];



How would I go about initializing a model like this, but with certain conditions? For example, I want exactly what the above code returns, but only for rows with id < 100, for example. I tried using ABC::model()->Stories >findAll($criteria), and that returns the rows that I want, but not in the same form as the above code returns. Ultimately I want to plug in a custom $model into a CGridView. The above works, but the ->findAll gives me errors when I plug it into CGridView. Any help is appreciated. Thanks.

I just saw in another topic to use


$dataProvider = new CActiveDataProvider('cars', array(

   'criteria'=>array(

        'condition'=>"category= 'some category' and dealer='{$model->id}'"

    )

));

This seems to work as it displays the appropriate rows in the CGridView. However, the filters are not working. It just displays the loading gif for a second and then nothing happens. When I use


dataProvider => $model->search(),

filter => $model

everything sorts fine, but when I do


dataProvider => $dataProvider, //the one defined above

filter => cars::model()

everything works fine except for the filters. Any help is appreciated, thanks.