madcorp / zfdatagrid

Automatically exported from code.google.com/p/zfdatagrid
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Ajax won't work after upgrade to ZFDatagrid 0.8 #891

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
It's several years I'm using ZFDatagrid in our webapps.

I have recently decided to upgrade the datagrid from 0.7 to the latest release 
(0.8).

I made all required changes as reported in 
http://code.google.com/p/zfdatagrid/wiki/Upgrade.

As of now all functionalities seem to be working nicely but the ajax.
In particular, the "setAjax" function seems to be ignored at all and all the 
datagrid links (i.e. the link for pagination)  are not ajax link.

What I can say is that:
- The datagrid has unique ID
- The grid doesn't use CRUD methods.
- The same code works very well with the previous ZFDatagrid release (0.7).

Maybe I'm missing something? Do you have suggestions?

The code I use to create the grid is the following:

 public function grid($id, $source = null, array $coloptions=null) {
        $config = new Zend_Config_Ini(APPLICATION_PATH . '/configs/grid.ini', 'production');
        $grid = Bvb_Grid::factory('Table', $config,$id);

        // I ALSO TESTED THIS WAY: AJAX STILL WON'T WORK AND MOREOVER ALL EXPORTS STOP TO WORK TOO
        //$grid = Bvb_Grid::factory('Table', $config);

        $grid->setAjax($id);
        $grid->setEscapeOutput(true);
        $grid->setcharEncoding('UTF-8');
        $grid->setDefaultEscapeFunction('htmlentities');
        $grid->setShowFiltersInExport(true);
        $grid->setExport(array('excel', 'print'));
        if (isset($source)) {
            $grid->setSource($source);
            $grid->setGridColumns($grid->getFields());
            $this->addExtraColumns($grid, $colptions);
        }

        $grid->setRecordsPerPage(10);
        $grid->setPaginationInterval(array('10' => '10', '50' => '50', '100' => '100'));
        $this->removePaginationOnExport($grid);
        $grid->setView($this->view);
        return $grid;
    }

Thank you in advance

Original issue reported on code.google.com by vfal...@gmail.com on 24 May 2013 at 12:59