PHP code example of pentium10 / yii-clear-filters-gridview

1. Go to this page and download the library: Download pentium10/yii-clear-filters-gridview library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

pentium10 / yii-clear-filters-gridview example snippets


    

array(
  'class'=>'EButtonColumnWithClearFilters',
   //'clearVisible'=>true,
   //'onClick_BeforeClear'=>'alert('this js fragment executes before clear');',
   //'onClick_AfterClear'=>'alert('this js fragment executes after clear');',
   //'clearHtmlOptions'=>array('class'=>'custom-clear'),
   //'imageUrl'=>'/path/to/custom/image/delete.png',
   //'url'=>'Yii::app()->controller->createUrl(Yii::app()->controller->action->ID,array("clearFilters"=>1))',
   //'label'=>'My Custom Label',
 ),

if (intval(Yii::app()->request->getParam('clearFilters'))==1) {
    EButtonColumnWithClearFilters::clearFilters($this,$model);//where $this is the controller
}

public function actionAdmin() {
        $model = new registration('search');
		if (intval(Yii::app()->request->getParam('clearFilters'))==1) {
			EButtonColumnWithClearFilters::clearFilters($this,$model);//where $this is the controller
		}
        $this->render('admin', array(
            'model' => $model,
        ));
}