Search code examples
zend-frameworkzfdatagrid

Filter table content


I don't quite understand the documentation for filters on the table, how do you update when the user enters something in the filter inputs? The values do not change when I try in my example. The current code for my table in the controller is this:

    $db = Zend_Db_Table::getDefaultAdapter();

    $grid = Bvb_Grid::factory('Table');
    $select = $db->select()->from('hosts');
    $grid->setSource(new Bvb_Grid_Source_Zend_Select($select));
    $grid->setImagesUrl('./images/');
    $grid->setUseKeyEventsOnFilters(true);
    $grid->saveParamsInSession(true);
    $myGrid = $grid->deploy();
    $this->view->hosts = $myGrid;

What do I need to add in order for the filters to update the table content?

Thank you for reading.


Solution

  • This was probably caused by not printing out javascript functions generated by ZFDatagrid.

    If it was not done before try to add:

    <?php echo $this->headScript();?>
    

    in <head> part of your layout or view template.