Ecolumns Cgridview Filter

So first off love this extension, does what I was looking for but it breaks filtering and search. Could someone help me get that working again?

So the filter shows up but it doesn’t work. Any help would be great.

in admin page


<?php 

$dialog = $this->widget('ext.ecolumns.EColumnsDialog', array(

       'options'=>array(

            'title' => 'Layout settings',

            'autoOpen' => false,

            'show' =>  'fade',

            'hide' =>  'fade',

        ),

       'htmlOptions' => array('style' => 'display: none'), //disable flush of dialog content

       'ecolumns' => array(

            'gridId' => 'user-grid', //id of related grid

            'storage' => 'db',  //where to store settings: 'db', 'session', 'cookie'

            'fixedLeft' => array('CCheckBoxColumn'), //fix checkbox to the left side 

            'model' => $model->search(), //model is used to get attribute labels

			

            'columns' => array(

               'username',

			   

               'password',

			   array( 

              'class' => 'editable.EditableColumn',

              'name' => 'status',

              'headerHtmlOptions' => array('style' => 'width: 100px'),

              'editable' => array(

                  'type'     => 'select',

                  'url'      => $this->createUrl('updateEditable',array('model'=>'User', 'field'=>'status')),

                  'source'   => array('1'=>'Active','0'=>'Not Active'),

                  

			 	 ),

			 ), 

                array(

        'class'=>'CButtonColumn',

         'header'=>'Toggle Details',

          'template'=>'{toggle}{view}{delete}{update}',

            'buttons'=>array(

              'toggle'=>array(

                        'label'=>'Details',                        

                             'imageUrl'=>Yii::app()->request->baseUrl.'/images/expand.png',  

                             'url'=>'Yii::app()->createUrl("user/getExtra", array("id"=>$data->id))',

                             'options'=>array('class'=>'toggle',


                                      ),

                               ),

                         ),

						),

					

           ),

       )

    ));

$this->widget('zii.widgets.grid.CGridView', array(

       'id' => 'user-grid',

       'dataProvider' => $model->search(),

	   'filter'=>$model,

       'columns' => $dialog->columns(),

       'template' => $dialog->link()."{summary}\n{items}\n{pager}",

));


?>

Ecolumns Yii Extension Page

Sorry resolved… Was trying other functions with actionAdmin() function once I set back to default it worked:


$model=new User('search');

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

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

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


    $this->render('admin',array(

        'model'=>$model,

    ));

Hi, Preacher. I love this extension as well but I have a problem of getting the result. Could you please help me to check where’s my error. I am new to yii framework and I wish to implement this extension. Thanks in advance.

Here’s my code:




<?php

//layout dialog

$dialog = $this->widget('ext.ecolumns.EColumnsDialog', array(

       'options'=>array(

            'title' => 'Layout settings',

            'autoOpen' => false,

            'show' =>  'fade',

            'hide' =>  'fade',

        ),

       'htmlOptions' => array('style' => 'display: none'), //disable flush of dialog content

       'ecolumns' => array(

            'gridId' => 'course-grid', //id of related grid

            'storage' => 'db',  //where to store settings: 'db', 'session', 'cookie'

            'fixedLeft' => array('CCheckBoxColumn'), //fix checkbox to the left side 

            'model' => $model->search(), //model is used to get attribute labels

            'columns' => array(

               'id',

		       'code',

		       'code2',

		       'name',

		       'type',

		       'credit_hour',

                array(

                  'name' => 'day',

                  'header' => 'day',

                ), 

                array(

                 'class'=>'CLinkColumn',

                 'header' => 'Link',

                ),

                array(

                 'class'=>'CButtonColumn',

                ),

                array(

                 'class'=>'CCheckBoxColumn',

                ),               

           ),

       )

));


//grid

$this->widget('zii.widgets.grid.CGridView', array(

       'id' => 'course-grid',

       'dataProvider' => $model->search(),

       'template' => $dialog->link()."{summary}\n{items}\n{pager}",

       'columns' => $dialog->columns(),

));

?>






public function actionAdmin()

	{

		$model=new Course('search');

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

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

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


		$this->render('admin',array(

			'model'=>$model,

		));

	}



I do not know why it returns an error of ‘[color="#FF0000"]CDbCommand failed to execute the SQL statement: SQLSTATE[42S02]: Base table or view not found: 1146 Table ‘testdb.tbl_columns’ doesn’t exist. The SQL statement executed was: select data from tbl_columns where id = :id [/color]’ How to solve it?

Does anyone knows how to solve this error? Any help would be much appreciated. Thanks.

Could you post the code used for search from your model e.g.

This is a sql error doesn’t look like your connected to the right table / db.


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('pole_number',$this->pole_number,true);

		$criteria->compare('notag_number',$this->notag_number,true);

		$criteria->compare('status',$this->status,true);

		


		return new CActiveDataProvider($this, array(

			'criteria'=>$criteria,

		));

	}

How can i export to csv, excel, or pdf from ecolumns with dynamic field? Anybody help me, please. Thanks.