Skip to content

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

@vfallik

Description

@vfallik

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions