searchyiizii-widgets

How to do not reset search results in Yii zii.widgets.grid.cgridview


I have zii.widgets.grid.cgridview on admin page, and when I search some records and visit view one of them, and after return to admin page results is reseted. May I save them someway?


Solution

  • As a suggestion:

    First disable Ajax update in your CGridView's view:

    'ajaxUpdate' => false
    

    Now, it sends data via GET request. If you save the current GET, it would be possible to use the result later. It is accessible with:

    $_GET['YOUR_MODEL_NAME'];
    

    If you want to use it in somewhere else, you can get values from GET and put it into a CDBCriteria.

    Others might offer another way.