Page 6 of 16
2 · 3 · 4 · 5 · 6 · 7 · 8 · 9 · 10

Eduardo :: 01.05.2011 14:01:24
I have a problem. I followed your tutorial and until this part echo $filter->filterForm('Document', array('legend' => 'Search')); it works but where i have to put this code? $this->Document->find('all', array('nofilter' => true)); I have tu put it inside mu index action? The only result that i had is the form and the submit does nothing. I appreciate yout help. Thanks.
lecterror :: 01.05.2011 17:53:56
Hi Eduardo,

If you read the article more carefully :) you'll see that you don't need to use that line to filter, you need to use it *not* to filter data.
Eduardo :: 02.05.2011 13:17:59
Ok i erase that and the form appears but when i hit submit nothing happens. What do i have to do? I dont know how to use it.
lecterror :: 02.05.2011 14:22:24
To answer that, I would have to see your code.. Are you sure you've set up the component properly? If the form shows up, it should be good, so have you tried filtering with some unique values?
Eduardo :: 02.05.2011 19:45:53
I´m gonna put my code here:

controller: <?php
class DocumentsController extends AppController {

var $name = 'Documents';

var $components = array('Filter.Filter');

var $helpers = array('Filter');



var $filters = array
(
'index' => array
(
'Document' => array
(
'Document.description',

'Document.title'

)
)
);


function index() {


}
}
?>

Model: <?php
class Document extends AppModel {

var $name = 'Document';

var $useTable = 'imoveis';

var $actsAs = array('Filtered');

}

view: <?php
echo $filter->filterForm('Document', array('legend' => 'Search')); ?>

Is there something wrong? What do i have to correct? Thanks.